Units: add inches (in) and pounds (lb) (#32196)

This commit is contained in:
Ryan Showalter 2021-03-22 08:28:39 -07:00 committed by GitHub
parent 7cd89b244e
commit de0c98771f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 0 deletions

View File

@ -685,6 +685,10 @@
"text": "meter (m)", "text": "meter (m)",
"value": "lengthm" "value": "lengthm"
}, },
{
"text": "inch (in)",
"value": "lengthin"
},
{ {
"text": "feet (ft)", "text": "feet (ft)",
"value": "lengthft" "value": "lengthft"
@ -727,6 +731,10 @@
"text": "gram (g)", "text": "gram (g)",
"value": "massg" "value": "massg"
}, },
{
"text": "pound (lb)",
"value": "masslb"
},
{ {
"text": "kilogram (kg)", "text": "kilogram (kg)",
"value": "masskg" "value": "masskg"
@ -1788,6 +1796,10 @@
"text": "meter (m)", "text": "meter (m)",
"value": "lengthm" "value": "lengthm"
}, },
{
"text": "inch (in)",
"value": "lengthin"
},
{ {
"text": "feet (ft)", "text": "feet (ft)",
"value": "lengthft" "value": "lengthft"
@ -1830,6 +1842,10 @@
"text": "gram (g)", "text": "gram (g)",
"value": "massg" "value": "massg"
}, },
{
"text": "pound (lb)",
"value": "masslb"
},
{ {
"text": "kilogram (kg)", "text": "kilogram (kg)",
"value": "masskg" "value": "masskg"
@ -2871,6 +2887,10 @@
"text": "meter (m)", "text": "meter (m)",
"value": "lengthm" "value": "lengthm"
}, },
{
"text": "inch (in)",
"value": "lengthin"
},
{ {
"text": "feet (ft)", "text": "feet (ft)",
"value": "lengthft" "value": "lengthft"
@ -2913,6 +2933,10 @@
"text": "gram (g)", "text": "gram (g)",
"value": "massg" "value": "massg"
}, },
{
"text": "pound (lb)",
"value": "masslb"
},
{ {
"text": "kilogram (kg)", "text": "kilogram (kg)",
"value": "masskg" "value": "masskg"

View File

@ -685,6 +685,10 @@
"text": "meter (m)", "text": "meter (m)",
"value": "lengthm" "value": "lengthm"
}, },
{
"text": "inch (in)",
"value": "lengthin"
},
{ {
"text": "feet (ft)", "text": "feet (ft)",
"value": "lengthft" "value": "lengthft"
@ -727,6 +731,10 @@
"text": "gram (g)", "text": "gram (g)",
"value": "massg" "value": "massg"
}, },
{
"text": "pound (lb)",
"value": "masslb"
},
{ {
"text": "kilogram (kg)", "text": "kilogram (kg)",
"value": "masskg" "value": "masskg"
@ -1788,6 +1796,10 @@
"text": "meter (m)", "text": "meter (m)",
"value": "lengthm" "value": "lengthm"
}, },
{
"text": "inch (in)",
"value": "lengthin"
},
{ {
"text": "feet (ft)", "text": "feet (ft)",
"value": "lengthft" "value": "lengthft"
@ -1830,6 +1842,10 @@
"text": "gram (g)", "text": "gram (g)",
"value": "massg" "value": "massg"
}, },
{
"text": "pound (lb)",
"value": "masslb"
},
{ {
"text": "kilogram (kg)", "text": "kilogram (kg)",
"value": "masskg" "value": "masskg"
@ -2871,6 +2887,10 @@
"text": "meter (m)", "text": "meter (m)",
"value": "lengthm" "value": "lengthm"
}, },
{
"text": "inch (in)",
"value": "lengthin"
},
{ {
"text": "feet (ft)", "text": "feet (ft)",
"value": "lengthft" "value": "lengthft"
@ -2913,6 +2933,10 @@
"text": "gram (g)", "text": "gram (g)",
"value": "massg" "value": "massg"
}, },
{
"text": "pound (lb)",
"value": "masslb"
},
{ {
"text": "kilogram (kg)", "text": "kilogram (kg)",
"value": "masskg" "value": "masskg"

View File

@ -280,6 +280,7 @@ export const getCategories = (): ValueFormatCategory[] => [
formats: [ formats: [
{ name: 'milligram (mg)', id: 'massmg', fn: SIPrefix('g', -1) }, { name: 'milligram (mg)', id: 'massmg', fn: SIPrefix('g', -1) },
{ name: 'gram (g)', id: 'massg', fn: SIPrefix('g') }, { name: 'gram (g)', id: 'massg', fn: SIPrefix('g') },
{ name: 'pound (lb)', id: 'masslb', fn: toFixedUnit('lb') },
{ name: 'kilogram (kg)', id: 'masskg', fn: SIPrefix('g', 1) }, { name: 'kilogram (kg)', id: 'masskg', fn: SIPrefix('g', 1) },
{ name: 'metric ton (t)', id: 'masst', fn: toFixedUnit('t') }, { name: 'metric ton (t)', id: 'masst', fn: toFixedUnit('t') },
], ],
@ -288,6 +289,7 @@ export const getCategories = (): ValueFormatCategory[] => [
name: 'Length', name: 'Length',
formats: [ formats: [
{ name: 'millimeter (mm)', id: 'lengthmm', fn: SIPrefix('m', -1) }, { name: 'millimeter (mm)', id: 'lengthmm', fn: SIPrefix('m', -1) },
{ name: 'inch (in)', id: 'lengthin', fn: toFixedUnit('in') },
{ name: 'feet (ft)', id: 'lengthft', fn: toFixedUnit('ft') }, { name: 'feet (ft)', id: 'lengthft', fn: toFixedUnit('ft') },
{ name: 'meter (m)', id: 'lengthm', fn: SIPrefix('m') }, { name: 'meter (m)', id: 'lengthm', fn: SIPrefix('m') },
{ name: 'kilometer (km)', id: 'lengthkm', fn: SIPrefix('m', 1) }, { name: 'kilometer (km)', id: 'lengthkm', fn: SIPrefix('m', 1) },