-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename metric -> SI * Fix build * Fix again
- Loading branch information
Showing
9 changed files
with
71 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { Measure, MetricSystem } from "safe-units"; | ||
import { Measure, SIUnitSystem } from "safe-units"; | ||
|
||
// START | ||
const meter = Measure.dimension(MetricSystem, "length"); | ||
const meter = Measure.dimension(SIUnitSystem, "length"); | ||
console.log(meter); // 1 m | ||
|
||
const second = Measure.dimension(MetricSystem, "time"); | ||
const second = Measure.dimension(SIUnitSystem, "time"); | ||
console.log(second); // 1 s | ||
// END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { Measure, MetricSystem, seconds } from "safe-units"; | ||
import { Measure, SIUnitSystem, seconds } from "safe-units"; | ||
|
||
// START | ||
const t = Measure.of(10, seconds); | ||
const doubledShort = t.scale(2); // 20 s | ||
const doubledLong = t.times(Measure.dimensionless(MetricSystem, 2)); // 20 s | ||
const doubledLong = t.times(Measure.dimensionless(SIUnitSystem, 2)); // 20 s | ||
// END | ||
|
||
console.log(doubledShort, doubledLong); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters