https://github.com/druids/fe
A money formatter
https://github.com/druids/fe
Last synced: 9 months ago
JSON representation
A money formatter
- Host: GitHub
- URL: https://github.com/druids/fe
- Owner: druids
- License: mit
- Created: 2019-04-16T10:21:15.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-08T10:07:23.000Z (almost 7 years ago)
- Last Synced: 2025-01-30T02:14:12.042Z (over 1 year ago)
- Language: Clojure
- Size: 12.7 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Fé
==
Fé is a library for money formatting.
[](https://circleci.com/gh/druids/fe)
[](https://jarkeeper.com/druids/fe)
[](https://opensource.org/licenses/MIT)
Leiningen/Boot
--------------
```clojure
[fe "0.1.1"]
```
Documentation
-------------
```clojure
(require '[fe.core :as fe])
(fe/fmt 10000 "EUR") ;; "10 000.00 EUR"
(fe/fmt 10000 "EUR" {:decimal-pos 0}) ;; "10 000 EUR"
(fe/fmt 10000 "EUR" {:part-sep ","}) ;; "10,000.00 EUR"
(fe/fmt 10000 "EUR" {:decimal-sep ","}) ;; "10 000,00 EUR"
(fe/fmt 10000 "£" {:currency-pos :prefix, :part-sep ","}) ;; "£10,000.00"
```
`fmt` function uses a non-breakable space by default (as Unicode character).
Contribution
------------
### Conventions
* Please follow coding style defined by [`.editorconfig`](http://editorconfig.org)
and [The Clojure Style Guide](https://github.com/bbatsov/clojure-style-guide)
* Write [good commit messages](https://chris.beams.io/posts/git-commit/)
and provide an issue ID in a commit message prefixed by `#`