-
Notifications
You must be signed in to change notification settings - Fork 28
Better to_s #40
Copy link
Copy link
Open
Description
Right now, alchemist provides very basic to_s methods. In the case of a simple measurement, they simply convert the float version of the measurement to a string:
irb(main):003:0> 1.meter.to_s
=> "1.0"
irb(main):004:0> 3.seconds.to_s
=> "3.0"In the case of compound measurements, they don't even do that much:
irb(main):005:0> 2.meters.per.second.to_s
=> "#<Alchemist::CompoundMeasurement:0x007ff3c18e9060>"
irb(main):006:0>It'd be awesome if it printed nice strings for these:
=> 1.meter.to_s
"1 meter"
=> 3.seconds.to_s
"3 seconds"
=> 1.s.to_s
"1 second"
=> 30.miles.per.hour
"30 miles/hour"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels