on 11-25-2021 11:32 AM
Hello experts,
I have a problem with a simple editing of a number.
From my API response I get various numbers with different decimal lengths. I save the value I need to the memory field "i". So I want to format it to round it to two decimal digits. The decimal seperator is a dot, which is fine for me.
My attemend looks like this:
{{formatNumber memory.i 2}}
Somehow it's not working.
Do you have any ideas?
Thanks in advance!
Regards,
Lukas
Hi Lukas,
when you say it is somehow not working I assume that the message does not show up at all. For that you could use the "Chat Preview" to test the flow and open the "Debug View" by clicking on the button in the top right corner. There should be a warning message explaining what the actual issue is. For example it could be that memory.i contains a JSON structure that contains the number instead of the raw value which would look like this
"Helper parameter '{ confidence: 0.92, raw: '2.56478', scalar: 2.56478 }' is not a parsable number (error code: 'ScriptingEngine - 0120', id: 'xxx')."
Please make sure that the formatNumber helper is only receiving the raw number value.
Hope this helps and best regards,
Stephan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
65 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.