Hello,
My issue seems to be easy to resolve but … I don’t find the solution.
In simple words : how can I transform a number in currency format with Robotframework ?
Example : 160000 becomes 160 000 €.
Is there a library or keyword which can do this or must I write a piece of Python code ?
not aware of any robot specific libraries that would to this … but python’s standard library has locale library. However, it will default to use your local “locale” settings (typically via environment variables) and and the output can change from machine to another if they are not set up to be identical locale wise.
*** test cases ***
currency test
${number} = Set Variable 160000
${currstring} = Evaluate "{:,.0f} €".format(${number}).replace(',', ' ')
Should Be Equal As Strings ${currstring} 160 000 €
Thanks for your answer.
It seems to be the good way to resolve my issue. I will test it !
Unfortunatly, I’m not a developer and the builtin “Evaluate” is very difficult to understand for me.
If your solution works, I would never found it alone lol
I used the string number formatter to format the number with commas( , ) and then used replace to replace the commas with spaces.
Learning python is not required for using robot framework, but learning some of the basics is pretty useful, I linked to the W3Schools site rather than the python documentation as I feel that W3Schools explains things better for non programmers, they also have a good python tutorial