decimal
decimal copied to clipboard
Incorrect formatting
It looks like d128 incorrectly interprets precision as width when printing values, for example:
let test: d128 = d128::from_str("123.12345678").unwrap();
print!("Should print 123.12345678, actual output: {:.8}", test);
This code prints 123.1234 instead of 123.12345678
Thanks for the report!
Care to provide a patch? Perhaps instead of fmt.pad
we should use fmt.pad_integral
to ignore precision? Would that work on all cases?
To be honest, I'm new to Rust, so I have no idea.