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 }}
Name | Pipe | Available Symbols |
---|---|---|
Temperature | wyas_temp |
|
Length | wyas_length |
|
Time | wyas_time |
|
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