Skip to content

Commit

Permalink
feat(time): add femtoseconds and picoseconds to best units
Browse files Browse the repository at this point in the history
Closes #588
  • Loading branch information
jonahsnider committed Apr 21, 2023
1 parent 119fed1 commit e6ec41d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
36 changes: 20 additions & 16 deletions packages/bundled-conversions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1158,14 +1158,16 @@ export const bestUnits = {
[[1, 'psi']],
[[1, 'F']],
[
[1, 'ns'],
[1000, 'μs'],
[1000000, 'ms'],
[1000000000, 's'],
[60000000000, 'min'],
[3600000000000, 'h'],
[86400000000000, 'd'],
[31536000000000000, 'y'],
[1, 'fs'],
[1000, 'ps'],
[1000000, 'ns'],
[1000000000, 'μs'],
[1000000000000, 'ms'],
[1000000000000000, 's'],
[60000000000000000, 'min'],
[3600000000000000000, 'h'],
[86400000000000000000, 'd'],
[3.1536e22, 'y'],
],
[
[1, 'tsp'],
Expand Down Expand Up @@ -1218,14 +1220,16 @@ export const bestUnits = {
[[1, 'Pa']],
[[1, 'C']],
[
[1, 'ns'],
[1000, 'μs'],
[1000000, 'ms'],
[1000000000, 's'],
[60000000000, 'min'],
[3600000000000, 'h'],
[86400000000000, 'd'],
[31536000000000000, 'y'],
[1, 'fs'],
[1000, 'ps'],
[1000000, 'ns'],
[1000000000, 'μs'],
[1000000000000, 'ms'],
[1000000000000000, 's'],
[60000000000000000, 'min'],
[3600000000000000000, 'h'],
[86400000000000000000, 'd'],
[3.1536e22, 'y'],
],
[
[1, 'mL'],
Expand Down
2 changes: 1 addition & 1 deletion packages/conversions/src/conversions/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Id} from '../types/index.js';

export const time: ReadonlyDeep<Family> = {
id: Id.Time,
best: ['ns', 'μs', 'ms', 's', 'min', 'h', 'd', 'y'],
best: ['fs', 'ps', 'ns', 'μs', 'ms', 's', 'min', 'h', 'd', 'y'],
conversions: [
{names: ['second', 'seconds'], symbols: ['s'], ratio: 1},
...expandMacro(Macros.si, {names: ['second', 'seconds'], symbols: ['s'], ratio: 1}),
Expand Down

0 comments on commit e6ec41d

Please sign in to comment.