Solved

convert decimal in vb.net

Posted on 2015-02-10
1
114 Views
Last Modified: 2015-02-10
Is it possible to convert decimal value from 0.2625502370637121681198235265D to 26.25 this decimal format?
0
Comment
Question by:VBdotnet2005
1 Comment
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
Comment Utility
One possible solution:
decimalVar = 0.2625502370637121681198235265 * 100;
decimal newValue= Convert.ToDecimal(decimalVar.ToString ("#.##"));

Open in new window


Another option is to use the Decimal.Round Method after you multiplied by 100.
0

Featured Post

Free Trending Threat Insights Every Day

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

9 Experts available now in Live!

Get 1:1 Help Now