?
Solved

convert decimal in vb.net

Posted on 2015-02-10
1
Medium Priority
?
130 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 36

Accepted Solution

by:
Miguel Oz earned 2000 total points
ID: 40601812
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

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month17 days, 3 hours left to enroll

862 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