Skip to content
/ litter Public

Number Literals Utility Library in clojure(script)

License

Notifications You must be signed in to change notification settings

benzap/litter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Litter - Number Literal Utility Library in Clojure(script)

1 What is it for?

To express big numbers in an easier to read way. Especially numbers with repeating zeros. It can be difficult to read 100000000, when it could be expressed as (lit/num :100M)

2 examples

General Number Literals

(require '[litter.core :as lit])

(lit/num "100") ;; 100
(lit/num "100,000") ;; 100000
(lit/num "100,000.2345") ;; 100000.2345
(lit/num "100,000,000") ;; 100000000
(lit/num :100M) ;; 100000000
(lit/num :100M2k20m) ;; 100002000.020
(lit/num :100M20M2k) ;; ERROR
(lit/num "100,000,000,00") ;; ERROR

About

Number Literals Utility Library in clojure(script)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published