jana
asked on
convert a string containing currency data into a currency or decimal in vb6, no matter the country currency
We have a code when called, the currency amount is passed to. If the currency is US Dollar, it's ok.
Example
We know it has to do with the regional setup of the computer (we think).
We tried:
val("C$16,000.1")
results is 0
Also CDbl, CDec, CLng, CULng, etc.
Please advice on the correct method to go about it.
Example
Print ccur("$16,000.1")
16000.1
However, if Canadian currency is sent gives a run-time 13 type mismatch error.Print ccur("C$16,000.1")
We know it has to do with the regional setup of the computer (we think).
We tried:
val("C$16,000.1")
results is 0
Also CDbl, CDec, CLng, CULng, etc.
Please advice on the correct method to go about it.
ASKER
Thanx for the info, prior placing the question we tried various setup via Regional but no success.
Is there another way to convert a the following value when the currency is not of USA?
Example, we would like while in the USA, convert a string Canadian currency to decimal value:
Is there another way to convert a the following value when the currency is not of USA?
Example, we would like while in the USA, convert a string Canadian currency to decimal value:
"C$16,000.10" to 16000.1
1. C$16,000.1 is not a standard format for international currency.
2. How many different currencies are in need of conversion?
3. Please post examples of those currency string values and the numeric value you need.
2. How many different currencies are in need of conversion?
3. Please post examples of those currency string values and the numeric value you need.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
With string input it ignores the regional leading currency symbol. On my system with UK setting the $ sign gives an error, but £ sign does not.
Via the regional settings it is possible to set any single character to be the currency symbol, but not two as in C$.