Solved

VB.Net - Format Value with Decimal

Posted on 2015-02-04
3
85 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
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…
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…

751 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