Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3885 from nalinbhardwaj/conversions
Browse files Browse the repository at this point in the history
Conversions: Added length units and fixed pressure units
  • Loading branch information
bsstoner authored Jan 25, 2017
2 parents 2113d41 + 0baa285 commit cbe5785
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 5 deletions.
36 changes: 32 additions & 4 deletions share/goodie/conversions/ratios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,34 @@ type: length
unit: millimeter
plural: millimeters
---
aliases:
- micrometre
- micrometres
- µm
- µms
factor: 1e06
type: length
unit: micrometer
plural: micrometers
---
aliases:
- nanometre
- nanometres
factor: 1e09
type: length
unit: nanometer
plural: nanometers
---
aliases:
- picometre
- picometres
- pm
- pms
factor: 1e12
type: length
unit: picometer
plural: picometers
---
aliases:
- thou
- thous
Expand Down Expand Up @@ -908,6 +936,8 @@ plural: kilopascals
aliases:
- megapa
- megapas
- mpa
- mpas
factor: 1e-06
type: pressure
unit: megapascal
Expand All @@ -921,9 +951,7 @@ type: pressure
unit: gigapascal
plural: gigapascals
---
aliases:
- pa
- pas
aliases: []
factor: 1e-05
type: pressure
unit: bar
Expand Down Expand Up @@ -1637,4 +1665,4 @@ aliases:
factor: 1.943844492440605
type: speed
unit: knot
plural: knots
plural: knots
38 changes: 37 additions & 1 deletion t/Conversions.t
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,42 @@ ddg_goodie_test(
physical_quantity => 'length'
})
),
'500 nanometer to pm' => test_zci(
'500 nanometers = 500,000 picometers',
structured_answer => make_answer({
markup_input => '500',
raw_input => '500',
from_unit => 'nanometers',
styled_output => '500,000',
raw_answer => '500000',
to_unit => 'picometers',
physical_quantity => 'length'
})
),
'500 nanometer to micrometer' => test_zci(
'500 nanometers = 0.500 micrometers',
structured_answer => make_answer({
markup_input => '500',
raw_input => '500',
from_unit => 'nanometers',
styled_output => '0.500',
raw_answer => '0.500',
to_unit => 'micrometers',
physical_quantity => 'length'
})
),
'17 micrometer in mil' => test_zci(
'17 micrometers = 0.669 thousandths of an inch',
structured_answer => make_answer({
markup_input => '17',
raw_input => '17',
from_unit => 'micrometers',
styled_output => '0.669',
raw_answer => '0.669',
to_unit => 'thousandths of an inch',
physical_quantity => 'length'
})
),
'36 months to years' => test_zci(
'36 months = 3 years',
structured_answer => make_answer({
Expand Down Expand Up @@ -2888,4 +2924,4 @@ ddg_goodie_test(
'1E300 miles in metres' => undef,
'5 pas.i to atm' => undef,
);
done_testing;
done_testing;

0 comments on commit cbe5785

Please sign in to comment.