dominikh / filesize

filesize is a small ruby class for handling filesizes with both the SI and binary prefixes, allowing conversion from any size to any other size.
MIT License
81 stars 16 forks source link

conversion math issue #9

Closed theinventor closed 9 years ago

theinventor commented 9 years ago

Hey there, can you explain if I'm doing this right?

2.1.5 :111 > Filesize.from("#{space_used} B").to_f
 => 125507590928.0 
2.1.5 :112 > Filesize.from("#{space_used} B").pretty
 => "116.89 GiB" 
2.1.5 :113 > Filesize.from("#{space_used} B").to_f("Gb")
 => 125.507590928 

Shouldn't the to_f("Gb") turn into 116.89 ?

theinventor commented 9 years ago

nevermind, it's GiB in the to_f :)