We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Idea: type of Measure, that could handle multi dimensional units of different types.
const distance = new Measure(1, 'km') const time = new Measure(1, 'h') const speed = new MultiMeasure(distance, time) String(speed) // "1 km/h" speed.to('m/s') // "0.28 m/s"
The text was updated successfully, but these errors were encountered:
const distance = new Measure(1, 'km') const time = new Measure(1, 'h') const speed = distance / time // new MultiMeasure(distance, time)
const distance = new Measure(1, 'km') const moreDistance = distance * 10 // new Measure(10, 'km') const area = distance * distance // new Measure(1, "km2")
This would be cool. Don't know if possible, should do a research on how operators work in JS.
Sorry, something went wrong.
It seems that JavaScript Operator Overloading is impossible.
Workaround with methods:
const distance = new Measure(1, 'km') const area = distance.multiply(distance) // new Measure(1, "km2")
const distance = new Measure(1, 'km') const time = new Measure(1, 'h') const speed = distance.divide(time) // new Measure(1, "km/h")
No branches or pull requests
Idea: type of Measure, that could handle multi dimensional units of different types.
The text was updated successfully, but these errors were encountered: