I am unable to log monetary (decimal numbers) value using task. For example, I can log 995 but if a decimal is typed for example 995,35 or 995.35 SambaPos writes NULL value in SQL.
Do you know if is possible to log decimals? or am I doing something wrong?
I was able to log the information but only by changing Windows regional setting from Spanish to English, this causes the replacement of the comma for the dot as decimal separator affecting my reports and accounts.
I need to be able to use Spanish regional settings which uses the comma as separator for decimal.
Does it work if ou set as string rather than number?
Pure number in JSON is unquoted, so perhaps the comma is messing up the json formatting.
You might need to ‘parse’/replace it in some way.
I has similar issue with entity custom data which is stored in json too, mine senario was double quotes and I have to replace on insert and than revers on read.
Neither really. It is a standard of JSON data to use comma to separate elements. So your comma decimal separator is probably breaking the JSON when SambaPOS tries to insert the record.
Try what @JTRTech suggested: set the Custom Field to be a String instead of a Number. That might work.
If it still doesn’t work, you will probably need to escape the comma in the Rule. Best to post a screenshot of your Rule so we can see what you are doing.
.replace() is a Javascript method. So if you read about and learn Javascript, then you will know how to use a lot of functions in SambaPOS because it uses a JScript engine for things like that.