Skip to content

Commit 539af9a

Browse files
committed
fix: print fix
1 parent 394d65d commit 539af9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contracts/test/live/PricePrinter.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ contract PricePrinterTest is Test {
4545
function printUsdPrice(address token, uint256 price) public view {
4646
uint256 integerPart = price / 1e8;
4747
uint256 fractionalPart = (price / 1e6) % 100;
48+
string memory zero = fractionalPart < 10 ? "0" : "";
4849
string memory result = string.concat(
49-
ERC20(token).symbol(), ": $", Strings.toString(integerPart), ".", Strings.toString(fractionalPart)
50+
ERC20(token).symbol(), ": $", Strings.toString(integerPart), ".", zero, Strings.toString(fractionalPart)
5051
);
5152
console.log(result);
5253
}

0 commit comments

Comments
 (0)