>>Hi everybody,
>>
>>Suppose I pass a value this way
>>
>>'555.55' (as part of the longer string) and pass its type as 'Y'.
>>
>>I need to make that string value to be returned as currency value in this case and be correctly passed as currency to other methods (so vartype will detect it as currency).
>>
>>I did a quick test in the command window:
>>
>>
>>val = $555.55
>>=MESSAGEBOX(VARTYPE(val))
>>
>>So, it worked, but I want it to be universal. Also, it should not depend on the default language/currency format settings.
>>
>>So, may be I should try just casting the value as Y to pass back?
>>
>>Thanks in advance.
>
>It works for me, and my default language is Bulgarian and currency is лв. :-)
I think CAST will be safer.
This is part of our 'Parse' method code:
CASE tcType == "N"
lvRetVal = VAL(lvRetVal)
lvRetVal = IIF(lvRetVal % 1 = 0, INT(lvRetVal), lvRetVal)
There is no 'Y' case currently and I'd like to add it.
Thanks.
If it's not broken, fix it until it is.
My Blog