Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Comma instead of dot
#1
is it possible to tell qm to accept comma in double variables ?
that could spare me some formating lines,
because may client prefers to see prices with comma and
even the mdb saves with comma (i know that be changed ...)


thanks
#2
QM functions use only . as decimal separator. Maybe some API functions can format/parse strings where , is decimal separator but I don't know, needs to look in MSDN.
#3
Code:
Copy      Help
double d=1.23
str s
setlocale LC_NUMERIC "Lithuanian"
s.fix(_snprintf(s.all(1000) 1000 "%g" d))
out s

double dd=atof(s)
out dd

;Here "Lithuanian" is a locale where , is decimal separator
;by default (but can be changed in Control Panel -> Regional...).
;Read more in MSDN Library.
;Note that setlocale changes locale for whole process (all threads).
;Intrinsic QM functions are not affected, unless you use QM 2.2.0 (then don't use setlocale).


Forum Jump:


Users browsing this thread: 1 Guest(s)