Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
3 numbers after point
Message
 
 
To
19/06/2007 07:31:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01234191
Message ID:
01234219
Views:
9
Hi Mohammed,

My e-mail is nnosonovsky at gmail dot com, but I'm afraid I would not have time to look at your form.

Here is an idea.
lnCurrency = 123456.6789
* Interesting, that using VAL on a character value yields only 2 digits
*lnCurrency = VAL(INPUTBOX("Enter currency value","Test",'1234.122'))

lcValue = alltrim(padr(m.lnCurrency,30)) && we use big enough number and the fact that padX functions work with numbers

lnPos = at(set("point"),m.lcValue) && Find the position of the digit in a value
if m.lnPos > 0
   lcIntPart = substr(m.lcValue,1,m.lnPos - 1) && Integer part
   lcDecimalPart = substr(m.lcValue, m.lnPos + 1) && Decimal part
ELSE
   lcIntPart = m.lcValue
   lcDecimalPart = ""   
ENDIF

=MESSAGEBOX("Integer part: " + m.lcIntPart)
=MESSAGEBOX("Decimal part: " + m.lcDecimalPart)


>hi,
>thank you i try it many tims, not works.
>
>i need to display this numbers as characters at my myform(textbox),
>
>i wish to sent the small form and the small table to your ps.email, but i can't see any ps.email.
>
>thanks
>
>>>hi all,
>>>
>>>i try to display 3 number without any round ,after point as character , i see 2 numbers all the time and roundit,
>>>
>>>i try to change this line aloan it works as numbers, but space as characters
>>>
>>>thank you for help.
>>>
>>>ex..
>>>lccurdaci=7798.697
>>>lccurdaci=RIGHT(ALLTRIM(STR(lncurrency,11,3)),3)
>>>? lccurdaci....7798.697
>>>
>>>
>>
>>In this particular code change first line to be lnCurrency = 7798.697
>>
>>Then the transformation should work. In other words, use different variables for number and for character display.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform