Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Currency and decimal convertor
#7
Macro
Code:
Copy      Help
str s
int hr

;--- currency ---

inp- s "a number in format that is set on your computer in control panel -> regional -> ... -> currency"

CURRENCY cy
hr=VarCyFromStr(@s LOCALE_USER_DEFAULT 0 &cy)
if(hr) end _s.dllerror("" "" hr)
out cy

;--- numbers ---

inp- s "a number in format that is set on your computer in control panel -> regional -> ... -> numbers"

double d
hr=VarR8FromStr(@s LOCALE_USER_DEFAULT 0 &d)
if(hr) end _s.dllerror("" "" hr)
out d

;---------------

;QM also uses these functions but it uses locale 0x409 (English US), not LOCALE_USER_DEFAULT.

;Google for:
;site:microsoft.com Locale Constants


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)