-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wishlist: some way to control output serialization #11
Comments
This would involve some way to encode systems of units. Something like this, maybe: InitSystem (
'si', [ qw(m kg s newton square-meter cubic-meter watt joule
pascal m/s coulomb volt farad ohm siemens tesla weber henry)
],
'cgs', [ qw(cm gm s dyne square-centimeter cubic-centimeter watt
erg dynes-per-square-centimeter centimeters-per-second)
],
'english', [ qw(foot slug s pound square-foot cubic-foot horsepower
foot-pound pounds-per-square-inch feet-per-second)
],
); |
A few things to note, your first system is not SI, but rather MKS. SI uses grams not kilograms. I think that if this was a goal, it would fit in with having loadable databases per instance. One would make a |
According to Wikipedia, it is kilograms. Another system that we'll definitely want support for is the Furlong/Firkin/Fortnight (FFF) system. :) |
Well I stand corrected, NIST |
There are other very good ways to specify output serialization. Here's how Math::Units::PhysicalValue does it: print ($rate + "0 miles/hour"), "\n" # prints 103.07 miles/hour Another would be a method to produce an output using the best SI prefix. Quoting jpierce on RT: "Since you already have prefix to exponent mapping, it would be mighty handy to have a method of taking a result like 1.055056e+18 (joules) and getting back: 1.055056, exa(joules)." |
This is another to-do item from the vault.
Here's an example from a post by John Clyman on comp.languages.perl.modules (http://tinyurl.com/7hy6p4u):
The text was updated successfully, but these errors were encountered: