Angular module wrapper inspired by convert-units
npm install --save ngx-units-converter
import {UnitsConvererModule} from 'ngx-units-converter'
(...)
@NgModule({
(...)
imports: [
UnitsConvererModule
]
(...)
})
Params
- from: string,
- to: string,
Optionals
- round: number
<p> {{ 20 | unitsConverter: { from: 'mm', to: 'in', round: 3 } }}</p>
export class YourClass {
public constructor(private _unitsConverorService: UnitsConverorService) {
this._unitsConverorService.measures()
}
}
{
unitname: string;
measure: string;
system: string;
definition: {
name: {
singular: 'Millimeter',
plural: 'Millimeters'
},
to_anchor: 1 / 1000
};
}
export class YourClass {
public constructor(private _unitsConverorService: UnitsConverorService) {
this._unitsConverorService.describe('mm')
}
}