Discussion (5)0
Log in or sign up to continue
set groupSeparator=##class(%SYS.NLS.Format).SetFormatItem("NumericGroupSeparator"," ")
write $fnumber(12345.678, ",", 2)
12 345.68

By default in english locale group separator is comma

Thanks Dmitry it was helpful to me as well.

$translate would be better here

write $translate("12 500", " ")

To remove everything except numbers use $zstrip:

write $zstrip("12 500", "*E'N")

Hi,

No, you will have to find a way to remove the spaces, for example:

USER>Set ValueA = 12500

USER>Set ValueB = "12 500"

USER>Write ValueA/($Replace(ValueB," ",""))
1