Solved

VB.Net - Format Value with Decimal

Posted on 2015-02-04
3
80 Views
Last Modified: 2015-02-04
Good Day Experts!

I am hoping you can help with a good way to achieve my results.  I have values that I want to insert a decimal point at the end.  For example, 45634 I would like to have 456.34. The variable holding 45634 is decimal.  

Is there an "easy" to put a decimal point in front of the 34? Or do I have to convert to a string and parse apart and then put it back together?

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
paulmacd earned 500 total points
ID: 40589237
You can just do something like...

Dim decValue as Decimal = CDec(45634) / 100

...and you can replace '45634' with a variable.  This will work as long as the last two digits are always after the decimal point.
0
 

Author Comment

by:Jimbo99999
ID: 40589374
Thanks for replying...I will try it!
0
 

Author Closing Comment

by:Jimbo99999
ID: 40589473
Works great!

Thanks again for the help,
jimbo99999
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now