The mission here is to output the final value in 5 decimal places, even if the decimals stop < 5 places, '0' is to be concatenated to it.
For example,
x = '7.317' -> '7.31700';
x = '8.14' -> '8.14000';
x = '1.2' -> '1.20000';
x = '1' -> '1.00000';
I understand using fn:format-number()
can resolve the matter, but is there an alternative to it?
I've tried the following,
1) y = concat(x, "100000");
2) substring(y, string-length(x) + 1, 5);
The result isn't promising though.
Checking through online, I notice some used string-length(for $i ...)
, didn't quite understand this part.
Can the community please assist me on this.
Thank you.