HealthSamurai/unit-map

Add extensible normalize logic

Closed this issue · 0 comments

KGOH commented

There is no support for custom units like ns and there needs to be a way for extension of ops/normalize via multimethod for key :ns in this example:
(chrono.ops/plus {:ns 99999} {:ns 999900001}) ;; => {:ns 1000000000}
Should be{:sec 1}
And (chrono.ops/plus {:ns 9999999} {:ns 999000001}) ;; => {:ns 1009000000}
Should be{:sec 1 :ms 9}