Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting Numbers into Strings
Message
De
25/01/2001 12:07:38
Mike Mattos
Nationwide Computers
Mississauga, Ontario, Canada
 
 
À
25/01/2001 11:47:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00468512
Message ID:
00468552
Vues:
13
I have used the concept before, but there are some issues with large numbers that do crop up!

What exactly are you trying to achieve? ( that is, if the start number is 1/3, you will have an infinite # of decimal places, ! )

I don't see any problems if you can control the extreme cases , so a smarter udf might be

n = int(orig_number)
decimals = orig_number - n

big_dec = decimals * 10^16

DO while int(big_dec/10)=big_dec/10 && if a factor of 10
big_dec=big_dec/10
enddo

str_decimals=str(big_dec)

now you can decide how many places of len(str_decimals) to show
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform