Solved

VB.Net - Format Value with Decimal

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

21 Experts available now in Live!

Get 1:1 Help Now