The Artima Developer Community
Sponsored Link

C# Answers Forum
rounding float values in C#

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
William Thompson

Posts: 11
Nickname: xarzu
Registered: Nov, 2007

rounding float values in C# Posted: Aug 30, 2011 8:47 AM
Reply to this message Reply
Advertisement
I have a float data type in C#.
Let's say its value is
5.827671
and I want to concat/round it to the nearest 100th place
5.83
How would I do that?

The value is ported to a string by
floatvalue.ToString()

Topic: TextBlock wrapping of text in Silverlight XAML file. Previous Topic   Next Topic Topic: Static members on generic types

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use