@wyas/units
TypeScript icon, indicating that this package has built-in type declarations

2.0.7 • Public • Published

This is a group of pipes and components that deal with unit conversions for Angular.

To use these pipes, add the following code to the module you are using:

import {{ WyasUnitPipesModule }} from '@wyas/units'

In your HTML, use this format:

{{ value | pipeName:start:finish:round }}

In the above code, start is the value you are converting from, finish is the value you are converting to, and round is the amount of decimals you want to round to (this is optional, default is 2). Here's an example:

{{ value | wyas_temp:"F":"C":5 }}

Pipes

Name Pipe Available Symbols
Temperature wyas_temp
  • "F" - Fahrenheit
  • "C" - Celcius
  • "K" - Kelvin
  • "R" - Rankine
  • "D" - Delisle
  • "N" - Newton
  • "Ré" - Réaumur
  • "Rø" - Rømer
None of these can be used with Metric prefixes.
Length wyas_length
  • "in" - inches
  • "ft" - feet
  • "yd" - yards
  • "mi" - miles
  • "thou" - thou
  • "m" - meters
"m" (meters) can be used with the Metric prefixes (see below).
Time wyas_time
  • "s" - seconds
  • "min" - minutes
  • "hour" - hours
  • "day" - days
  • "week" - weeks
  • "month" - months
  • "year" - years
"s" (seconds) can be used with the Metric prefixes (see below).

Some of the symbols in the previous table allow prefixes from the Metric system (centi-, milli-, etc.). These symbols include:

  • "m" - meters
  • "s" - seconds

To use prefixes with these symbols, add the following letter(s) to the beginning of each symbol:

  • "k" - kilo

  • "c" - centi

  • "m" - milli

  • "da" - deca

  • "d" - deci

  • "h" - hecto

  • "μ" - micro

  • "n" - nano

  • "p" - pico

  • "f" - femto

  • "a" - atto

  • "z" - zepto

  • "y" - yocto

  • "M" - mega

  • "G" - giga

  • "T" - tera

  • "P" - peta

  • "Em" - exa

  • "Z" - zetta

  • "Y" - yotta

Readme

Keywords

none

Package Sidebar

Install

npm i @wyas/units

Weekly Downloads

0

Version

2.0.7

License

none

Unpacked Size

98.4 kB

Total Files

10

Last publish

Collaborators

  • loganwyas