I have a requirement where I have to publish a float/decimal number(not string) with fixed decimal digits in json
For eg. If I have a float value as 10.12345, the output json should look like:
{
"number": 10.123450
}
on the other hand if I have 10.12345678 , this should be mapped to output json (without rounding off):
{
"number": 10.123456
}
I have tried with format
but it produces result as String and If I again cast it to float it will lose the trailing 0's or rounding off the number.
Is it achievable without losing the datatype from number to String.
Regards,