Skip to main content
deleted 7 characters in body
Source Link

Please noteNote that FixedU128 is not a floating point type. It represents floating point numbers using u128 type with 18 digits of precision. This means that the last 18 digits of any number are taken to be the fractional part and the rest are taken to be the integer part.

This way, we can represent 1.23 as 1_230_000_000_000_000_000. Where 230_000_000_000_000_000 is the fractional part and 1 is the integer part.

So 500000000000000000 is the correct value. You can see that by printing it using the debug format

log::info!("value of integer is {:?}", fixed_value);

Please note that FixedU128 is not a floating point type. It represents floating point numbers using u128 type with 18 digits of precision. This means that the last 18 digits of any number are taken to be the fractional part and the rest are taken to be the integer part.

This way, we can represent 1.23 as 1_230_000_000_000_000_000. Where 230_000_000_000_000_000 is the fractional part and 1 is the integer part.

So 500000000000000000 is the correct value. You can see that by printing it using the debug format

log::info!("value of integer is {:?}", fixed_value);

Note that FixedU128 is not a floating point type. It represents floating point numbers using u128 type with 18 digits of precision. This means that the last 18 digits of any number are taken to be the fractional part and the rest are taken to be the integer part.

This way, we can represent 1.23 as 1_230_000_000_000_000_000. Where 230_000_000_000_000_000 is the fractional part and 1 is the integer part.

So 500000000000000000 is the correct value. You can see that by printing it using the debug format

log::info!("value of integer is {:?}", fixed_value);
Source Link

Please note that FixedU128 is not a floating point type. It represents floating point numbers using u128 type with 18 digits of precision. This means that the last 18 digits of any number are taken to be the fractional part and the rest are taken to be the integer part.

This way, we can represent 1.23 as 1_230_000_000_000_000_000. Where 230_000_000_000_000_000 is the fractional part and 1 is the integer part.

So 500000000000000000 is the correct value. You can see that by printing it using the debug format

log::info!("value of integer is {:?}", fixed_value);