Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Keeping last 4 digits?
Message
De
08/07/2006 19:21:09
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/07/2006 16:20:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01134716
Message ID:
01134729
Vues:
19
>I have a series of numbers with up to 9 significant digits after the decimal point and would like to truncate the character values down to 4 significant digits.
>
>For example I have the following two values:
>
>123.456789012
>98.765432109
>
>I want to return these values:
>
>123.4567
>98.7654
>
>I can write a function to use something like ATC() to find the decimal point but is there a better way? Sergey, you will no doubt have something interesting and insightful so thanks in advance...:>)

? INT(m.lnNumber)+int((m.lnNumber - INT(m.lnNumber))*10^4)/10^4
PS:
? INT(m.lnNumber*10^4)/10^4
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform