uint's don't zero-pad when formatted with formatting specifier
Closed this issue · 0 comments
stanleyjzheng commented
Version
ruint 1.12.1
Platform
Macos arm64
Description
Ethers properly formats zero-padding with the format!() macro, but it seems like alloy's uints ignore it. A minimal example would be
use alloy_primitives::U256;
let x = U256::from(10);
assert_eq!(
format!("{:0>width$}", x, width = 18_usize),
format!("{:0>width$}", x.to_string(), width = 18_usize)
)