diff options
author | Joris | 2020-02-02 13:53:54 +0100 |
---|---|---|
committer | Joris | 2020-02-02 13:58:19 +0100 |
commit | 0ce8744897b9aa13ea568a6985da9570e4aca90b (patch) | |
tree | 3619508ff9ec5d846c567c3562d05ca77e686c76 /js/src/Number.purs | |
parent | 13d29804ba4bb8d578fb0278ddeb6e187bbafa6f (diff) |
Use zola generator
- Use CSS instead of Haskell with Clay
- Use TypeScript instead of PureScript
Diffstat (limited to 'js/src/Number.purs')
-rw-r--r-- | js/src/Number.purs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/js/src/Number.purs b/js/src/Number.purs deleted file mode 100644 index 0403f19..0000000 --- a/js/src/Number.purs +++ /dev/null @@ -1,22 +0,0 @@ -module Number - ( format - , roundAt - ) where - -import Data.Int (round, toNumber, pow) as Int -import Data.String (Pattern(..), Replacement(..)) -import Data.String (replace) as String -import Math (round) as Math -import Prelude - -format :: Number -> String -format number = - if Math.round number == number then - show (Int.round number) - else - String.replace (Pattern ".") (Replacement ",") (show (roundAt 1 number)) - -roundAt :: Int -> Number -> Number -roundAt at n = - let exp = Int.toNumber (Int.pow 10 at) - in Math.round (n * exp) / exp |