garden icon indicating copy to clipboard operation
garden copied to clipboard

Multiplication of percentages

Open Hendekagon opened this issue 6 years ago • 4 comments

(percent* (percent 50) (percent 50))
=> #garden.types.CSSUnit{:unit :%, :magnitude 2500}

Hendekagon avatar Mar 05 '18 18:03 Hendekagon

@Hendekagon Can you elaborate?

noprompt avatar Mar 12 '18 06:03 noprompt

I guess a :magnitude of 25 would be the expected result

hkjels avatar Mar 12 '18 08:03 hkjels

@hkjels Thanks for parsing that one for me! A patch would be greatly appreciated. This definitely seems like unfavorable behavior.

noprompt avatar Mar 12 '18 22:03 noprompt

This appears to be fixed:

user=> (require 'garden.units)
nil
user=> (garden.units/percent* (garden.units/percent 50) (garden.units/percent 50))
#garden.types.CSSUnit{:unit :%, :magnitude 25}

c.f., https://github.com/noprompt/garden/commit/75c2a4075848182ab08afaebfd8cadeae8156646

harold avatar May 26 '22 18:05 harold