Created
December 16, 2024 20:18
-
-
Save arekbartnik/b89e75381cd04416d33355d209151c44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function rounded(number: number, decimals: number = 2): number { | |
return Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment