Add support for Imperial Units (oz, lb) #1
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Gram only works with metric units; support for imperial units could be useful.
Currently supported units :
kg, g, mg, l (liter), dl, cl, ml
Hey! I've submitted a pull request (#2 ) to add more units :D both American imperial and some UK units as well!
Most of the changes are to the UNIT_CONVERSION constant but I also added my own tests for my code!
Let me know if any more changes are needed or if their are any issues!
Thanks! I think that for recipes, a simple conversion between volumes and weights/masses won't be enough, as a volume of water ≠ a volume of flour. I believe the implementation will require precise management of ingredients and their volume-to-weight ratios. We'll have to see whether this should be integrated directly into the parser or handled as an external function. I'm continuing to explore the matter !