โ01-11-2022 07:53 AM
Hi, I get as JSON input
{
"amount" : 1000
}
I would like to convert 1000 to 1000.00
{
"amount" : 1000.00
}
How?
I do not want to convert to โ1000.00โ which toFixed(2) does.
thank you.
Solved! Go to Solution.
โ01-12-2022 12:22 AM
Actually, It will not. I agree with @viktor_n on this one. This is a validation from the pipeline you attached:
Donโt rely on the preview within the snap, check the actual output after validation.
Regards,
Bojan
โ01-11-2022 08:04 AM
โ01-11-2022 11:16 PM
Puh! Apologies, that I have not described everything I had tried before posting.
Among others, I had tried parseFloat as well.
I wonder if you have tried it yourself, jolly good. Pipeline is attached
parseFloat($amount.toFixed(2))
will remove the decimal โ.00โ, so this brings nothing.
As a result you would get: 1000 โ โ1000.00โ โ 1000
Again I need to add decimals to 1000 to get 1000.00, NOT to โ1000.00โ
{
"amount" : 1000.00
}
anyone?
thank you.
toDouble_2022_01_12.slp (5.9 KB)
โ01-12-2022 12:22 AM
Actually, It will not. I agree with @viktor_n on this one. This is a validation from the pipeline you attached:
Donโt rely on the preview within the snap, check the actual output after validation.
Regards,
Bojan
โ01-12-2022 02:17 AM
Arrgh! Indeed, Bojan, you are right. I always forget, that one should not relay on just a half-reliable platform. Also, if runtime presents the result same as validation.
Terribly sorry for that. I suppose, it comes from the habit of using other mature integration tools. I promise to remember that in the future. I must admit, it presents a certain kind of a thrill โOh goodie! which feature is reliable in this release, my-oh-my!โ - very exciting.
Thank you and kind regards.
Output:
[{"amount":1000.00}]
Updated pipeline attached.
toDouble_2022_01_12.slp (8.6 KB)