VB Tips: Count how many numbers in a double

In community someone asked how to count the numbers of a decimal number. Classic example of how you might use Linq in a single line of code:

Dim DoubleNumber As Double = 54637.3456789
Dim Count As Integer = DoubleNumber.ToString("f").Where(Function(c) Char.IsDigit(c)).Count
HTH
Alberto

Print | posted on mercoledì 30 marzo 2011 10.18

Feedback

# re: VB Tips: Count how many numbers in a double

Left by Nike Dunk Low at 22/02/2012 10.54
Gravatar NINIKEFJA WEJRWER

# Air Jordan Spizikes

Left by Air Jordan Spizikes at 15/03/2012 7.24
Gravatar WQWQEThe money as the gods, it will be a devil evil to you. No money is sad. But money is times excess had sorrow. I worship created the spirit, worship force, worship, worship the heart, blood I worship the bomb, worship mourning, and worship damage.

# zapatillas puma

Left by zapatillas puma at 10/05/2012 5.47
Gravatar For man is man and master of his fate.

Your comment:





 
Please add 6 and 3 and type the answer here:

Copyright © Alberto De Luca

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski