0.0.22 • Published 6 years ago

ember-railio-convert-unit v0.0.22

Weekly downloads
22
License
MIT
Repository
github
Last release
6 years ago

ember-railio-convert-unit

An Ember addon for converting units.

Install

In your application's directory:

$ ember install ember-railio-convert-unit

Usage

Available units

These units can be used to pass as fromUnit and toUnit (second and third arguments).

Unit groupAvailable units
Weightskilos, tons
Metricsfeet, teu
Metricsmillimeters, centimeters, meters, kilometers
Timemilliseconds, seconds, minutes, hours

Use as a function

import convertUnit from 'ember-railio-convert-unit';

//            convertUnit(value, fromUnit, toUnit)
let meters  = convertUnit(2, 'kilometers', 'meters');
let minutes = convertUnit(2, 'hours', 'minutes');

Use as a computed property

import convertUnitProperty from 'ember-railio-convert-unit';

export default EmberObject.extend({
  //                 convertUnitProperty(propertyName, fromUnit, toUnit)
  lengthInMeters:    convertUnitProperty('lengthInKm', 'kilometers', 'meters'),
  durationInMinutes: convertUnitProperty('duration', 'seconds', 'minutes')
});

For more information on using ember-cli, visit https://ember-cli.com/.

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago