4 ms·
Decimal handling shouldn't be too difficult. Use an integer of the appropriate size for storage and scale by 10^n where n is the number of decimal places. E.g.
by Kristine1975 11y ago
Decimal handling shouldn't be too difficult. Use an integer of the appropriate size for storage and scale by 10^n where n is the number of decimal places. E.g. (my COBOL is a little rusty)
price PIC 999V99
...
move 3.14 to price
would result in the WebAssembly equivalent of
price = 314
In other words: Use fixed-point arithmetic, but with base-10 instead of base-2.