Number formatting
@Number I format <valueRef> from "<source-format>" to "<target-format>" as <name>
Converts the given numeric value to another format and stores the result in the given name in the global scope.
@Number I format <valueRef> from "<source-format>" to "<target-format>" as <name>
Where
<valueRef>is the name of the binding containing the source numeric value- Can be the name of any binding that contains or resolves to a numeric value, including a web element in which case the text in the element will be dynamically retrieved and used.
<source-format>is the source decimal number format pattern to convert from<target-format>is the target decimal number format pattern to convert to<name>is the name to bind the formatted numeric value to
Example
Given number is "1234"
When @Number I format number from "#" to "$#,##0.00" as dollars
Then dollars should be "$1,234.00"
Since v4.18.1, Gwen also supports ordinal suffixes (1st, 2nd, 3rd, 4th, etc..)
Given number is "22"
When @Number I format number from "#" to "#(st|nd|rd|th)" as ordingal number
Then ordingal number should be "22nd"
And (converting the other way)
Given ordingal number is "1st"
When @Number I format ordingal number from "#(st|nd|rd|th)" to "00" as leading zero number
Then leading zero number should be "01"