W Wouter van Teeseling Jun 12, 2009 #1 How can I shorten a float number just for 2 figures behind dhe comma e.g. from 0.123456 to 0.12.
C Christof Nordiek Jun 17, 2009 #2 Wouter van Teeseling said: How can I shorten a float number just for 2 figures behind dhe comma e.g. from 0.123456 to 0.12. Click to expand... if by shorten you mean rounding: se Peter's post. if by shorten you mean truncating: Though Math.Truncate doesn't have overloads with decimals paramter you still can do someting like: truncatedValue = Math.Truncate(rawValue * 100)/100 Christof
Wouter van Teeseling said: How can I shorten a float number just for 2 figures behind dhe comma e.g. from 0.123456 to 0.12. Click to expand... if by shorten you mean rounding: se Peter's post. if by shorten you mean truncating: Though Math.Truncate doesn't have overloads with decimals paramter you still can do someting like: truncatedValue = Math.Truncate(rawValue * 100)/100 Christof