Fix floorToDecimal when there are zero decimals

This commit is contained in:
Nathaniel Parke 2021-02-15 17:46:27 +08:00
parent da08dd706e
commit c1c1cfe43c
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ export function floorToDecimal(
value: number,
decimals: number | undefined | null,
) {
return decimals ? Math.floor(value * 10 ** decimals) / 10 ** decimals : value;
return decimals ? Math.floor(value * 10 ** decimals) / 10 ** decimals : Math.floor(value);
}
export function roundToDecimal(