Skip to content

Commit

Permalink
feat(energy): include other SI prefixes for watt hours (#619)
Browse files Browse the repository at this point in the history
* feat(energy): use SI macro for watt-hour units

Although watt-hours are technically non-SI units, they use the same set
of prefixes.

* test: update snapshots

* fix: increase size limit
  • Loading branch information
furrycatherder committed Nov 18, 2023
1 parent b7e0bca commit 4a30e7a
Show file tree
Hide file tree
Showing 5 changed files with 298 additions and 2 deletions.
59 changes: 59 additions & 0 deletions packages/bundled-conversions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,69 @@ export const conversions = {
femtojoule: [3, 1e-15],
femtojoules: [3, 1e-15],
fJ: [3, 1e-15],
'watt-hour': [3, 3600],
'W⋅h': [3, 3600],
'W h': [3, 3600],
Wh: [3, 3600],
'petawatt-hour': [3, 3600000000000000000],
'PW⋅h': [3, 3600000000000000000],
'PW h': [3, 3600000000000000000],
PWh: [3, 3600000000000000000],
'terawatt-hour': [3, 3600000000000000],
'TW⋅h': [3, 3600000000000000],
'TW h': [3, 3600000000000000],
TWh: [3, 3600000000000000],
'gigawatt-hour': [3, 3600000000000],
'GW⋅h': [3, 3600000000000],
'GW h': [3, 3600000000000],
GWh: [3, 3600000000000],
'megawatt-hour': [3, 3600000000],
'MW⋅h': [3, 3600000000],
'MW h': [3, 3600000000],
MWh: [3, 3600000000],
'kilowatt-hour': [3, 3600000],
'kW⋅h': [3, 3600000],
'kW h': [3, 3600000],
kWh: [3, 3600000],
'hectowatt-hour': [3, 360000],
'hW⋅h': [3, 360000],
'hW h': [3, 360000],
hWh: [3, 360000],
'decawatt-hour': [3, 36000],
'daW⋅h': [3, 36000],
'daW h': [3, 36000],
daWh: [3, 36000],
'deciwatt-hour': [3, 360],
'dW⋅h': [3, 360],
'dW h': [3, 360],
dWh: [3, 360],
'centiwatt-hour': [3, 36],
'cW⋅h': [3, 36],
'cW h': [3, 36],
cWh: [3, 36],
'milliwatt-hour': [3, 3.6],
'mW⋅h': [3, 3.6],
'mW h': [3, 3.6],
mWh: [3, 3.6],
'microwatt-hour': [3, 0.0036],
'μW⋅h': [3, 0.0036],
'µW⋅h': [3, 0.0036],
'μW h': [3, 0.0036],
'µW h': [3, 0.0036],
μWh: [3, 0.0036],
µWh: [3, 0.0036],
'nanowatt-hour': [3, 0.0000036],
'nW⋅h': [3, 0.0000036],
'nW h': [3, 0.0000036],
nWh: [3, 0.0000036],
'picowatt-hour': [3, 3.6e-9],
'pW⋅h': [3, 3.6e-9],
'pW h': [3, 3.6e-9],
pWh: [3, 3.6e-9],
'femtowatt-hour': [3, 3.6e-12],
'fW⋅h': [3, 3.6e-12],
'fW h': [3, 3.6e-12],
fWh: [3, 3.6e-12],
newton: [4, 1],
newtons: [4, 1],
N: [4, 1],
Expand Down

0 comments on commit 4a30e7a

Please sign in to comment.