How to get the size of a number in .net?
I want with a given double number to return its "size" (known as |number|, or number of digit without the numbers after the dot), for example: 12.324654 -> 2 12 -> 2 0.99 -> 0 1.01 -> 1 901 -> 3 -0.99 -> 0 -9.999 -> 1 There must be a function is .net that I dont familiar with that does it.. Thanks. ((int)Math.Abs(12.324654)).ToString().Length Math.Abs will convert to positive number (don't want to count the negative sign) (int) will drop the digits following the decimal point ToString() converts to a string ===> "12" Length tells you how many characters there are there is an edge case where