npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@akapok/ember-unit-converter-helper

v2.2.0

Published

An Ember.js helper to convert units of measurement.

Downloads

49

Readme

ember-unit-converter-helper

This helper allow you to convert a number from a unit to another. Like meters in decimeters, litres to millilitres, seconds to hours...

Table of Contents

Compatibility

  • Ember.js v4.4 or above
  • Ember CLI v4.4 or above
  • Node.js v16 or above

Installation

Via NPM

npm install @akapok/ember-unit-converter-helper

Via Ember-CLI

ember install @akapok/ember-unit-converter-helper

Usage

Arguments

This addon provides a single helper called convert. It accepts 5 arguments | Arguments | Type | Description | Mandatory ? | Default | | :--- | :----: | :----: | :--- | :--- | | value | Number | The value you want to convert | Yes | N/A | | from | String | The abbrevation of the unit you convert from | Yes | N/A | | to | String | The abbrevation of the unit you convert to | Yes | N/A | | withUnit | Boolean | Do you want the result to be displayed with the unit abbrevation ? | No | Yes | | digit | Number | The amount of digit you want to keep | No | No limit set |

Basic Use

In your code:

<!-- We want to convert 1 meters into millimeters-->
{{convert value=1 from="m" to="mm" withUnit=false}}

The result:

1000mm

Without the unit abbrevation

In your code:

{{convert value=1 from="m" to="mm" withUnit=false}}

The result:

1000

With a limited amount of digits

In your code:

{{convert value=134.678 from="m" to="km" digits=2}}

The result:

0.13km (instead of 0.134678km)

:warning: Warning: The digit option also round your result. For example 0.146 with 2 digits returns 0.15

Supported units

Distance

| Name | Abbrevation | | :------------ | ----------: | | Femtometer | fm | | Picometer | pm | | Nanometer | nm | | Micrometer | μm | | Millimeter | mm | | Centimeter | cm | | Decimeter | dm | | Meter | m | | Decameter | dam | | Hectometer | hm | | Kilometer | km | | Inch | in | | Foot | ft | | Yard | yd | | Mile | mi | | Nautical Mile | nmi |

Weight

| Name | Abbrevation | | :-------- | ----------: | | Femtogram | fg | | Picogram | pg | | Nanogram | ng | | Microgram | μg | | Milligram | mg | | Centigram | cg | | Decigram | dg | | Gram | g | | Decagram | dag | | Hectogram | hg | | Kilogram | kg | | Pound | lb | | Ounce | oz |

Volume

| Name | Abbrevation | | :--------------- | ----------: | | Femtolitre | fl | | Picolitre | pl | | Nanolitre | nl | | Microlitre | μl | | Millilitre | ml | | Centilitre | cl | | Decilitre | dl | | Litre | l | | Decalitre | dal | | Hectolitre | hl | | Kilolitre | kl | | Gallon (UK) | UK gal | | Gallon (US) | US gal | | Fluid ounce (UK) | UK fl oz | | Fluid ounce (US) | US fl oz | | Pint (UK) | UK pt | | Pint (US) | US pt |

Time

| Name | Abbrevation | | :----- | ----------: | | Second | s | | Minute | min | | Hour | h | | Day | d | | Week | w | | Year | y |

Luminous intensity

| Name | Abbrevation | | :----------- | ----------: | | Femtocandela | fcd | | Picocandela | pcd | | Nanocandela | ncd | | Microcandela | μcd | | Millicandela | mcd | | Centicandela | ccd | | Decicandela | dcd | | Candela | cd | | Decacandela | dacd | | Hectocandela | hcd | | Kilocandela | kcd | | Candlepower | cp |

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.