Need currency post-processor to be used for all currency amounts. The logic for the post-processor should handle the following cases:
14.978.00 -> 14,978.00
14.97800 -> 14,978.00
14,97800 -> 14,978.00
Logic is as follows:
If the number is well formed (commas in correct place and at most one decimal point found with 2 digits after it)- then do nothing.
Else if a decimal point is found in a position where a comma would make sense, then change the decimal point to a comma (change decimal to a comma if the decimal has 3 or more numbers to the right of it)
After doing step 2, Any number that ends in a comma followed by 5 digits (
,nnnnn
) should be converted to,nnn.nn
.