I’m trying to use the function cleardecimalsoption() but in order to ensure that it does what I hope it does, I want to know when certain decimals are removed. Is there a knowledge base where the functions are listed, along with an explanation of how they work?
Alternatively, how can it be tested in the expressiedebugger with test values to double check that it does what it is supposed to?
When a decimal value is retrieved using a Novulo expression, it is tagged with a “decimals option” that stores the number of decimals that value should have according to the application model. The cleardecimalsoption() removes that tag and the setdecimalsoption#() functions sets it to a specific value.
The decimals option is - among other things - used when converting the value to a string with the tostring() function.
You can use that to test it with the expression debugger. For example, the quantity field of sales lines is defined to have two decimals. When you have a sales line with id=1 and quantity=1.00, the following expression will return <“1,00”,“1,00000”,“1”>:
<
saleslines:load(1).quantity.tostring(),
saleslines:load(1).quantity.setdecimalsoption5().tostring(),
saleslines:load(1).quantity.cleardecimalsoption().tostring()
>