Solved

VB.Net - Format Value with Decimal

Posted on 2015-02-04
3
84 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 34

Accepted Solution

by:
Paul MacDonald 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

713 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