convert decimal in

Is it possible to convert decimal value from 0.2625502370637121681198235265D to 26.25 this decimal format?
Who is Participating?
Miguel OzConnect With a Mentor Software EngineerCommented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.