Skip to content

Formatter an Convert units from differents sports

License

Notifications You must be signed in to change notification settings

vallsjm/convert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@vallsjm/convert

npm (scoped)

Formatter an Convert units from differents sports.

Install

$ npm install @vallsjm/convert

Example

$ npm start

Usage

import {Convert, Formatter} from '@vallsjm/convert'

let cv = new Convert({
    locale: 'es'
});

console.log("Convert");
console.log('5 Metros son ' + cv.convert(5, 'UNIT_YARDS') + ' Yardas');
console.log('5.468 Yardas son ' + cv.revert(5.468, 'UNIT_YARDS') + ' Metros');
console.log('Las Yardas tienen ' + cv.digits('UNIT_YARDS') + ' dígitos');
console.log('Mostrar Yardas con unidades ' + cv.units(5.468, 'UNIT_YARDS'));


let ft = new Formatter({
    locale: 'es',
    metrics: 'international'
});

console.log("");
console.log("Formatter");
console.log('500.4343434 Metros (ciclismo) son ' + ft.formatDistance(500.4343434));
console.log('500.4343434 Metros (ciclismo) son ' + ft.formatDistance(500.4343434, false));
console.log('500.4343434 Metros (ciclismo britanico) son ' + ft.metrics('english').formatDistance(500.4343434));

ft.metrics('international').sport('swimming');

console.log('500.4343434 Metros (natación) son ' + ft.formatDistance(500.4343434));
console.log('1572176282 Timestamp son ' + ft.sport('running').formatDate(1572176282));
console.log('1572176282 Timestamp (en inglés) son ' + ft.locale('en').formatDateTime(1572176282));
console.log('1572176282 Timestamp (en inglés) son ' + ft.formatDateDay(1572176282));

About

Formatter an Convert units from differents sports

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published