mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
19 lines
584 B
TypeScript
19 lines
584 B
TypeScript
/// <reference path="./bytes.d.ts"/>
|
|
|
|
import bytes = require('bytes');
|
|
|
|
// 1024*1024 = 1048576
|
|
console.log(bytes(104857));
|
|
console.log(bytes(104857, { thousandsSeparator: ' ' }));
|
|
|
|
console.log(bytes.format(104857));
|
|
console.log(bytes.format(104857, { thousandsSeparator: ' ' }));
|
|
console.log(bytes.format(104857, { decimalPlaces: 2 }));
|
|
console.log(bytes.format(104857, { fixedDecimals: true }));
|
|
console.log(bytes.format(104857, { unitSeparator: '-' }));
|
|
console.log(bytes('1024kb'));
|
|
console.log(bytes(1024));
|
|
|
|
console.log(bytes.parse('1024kb'));
|
|
console.log(bytes.parse(1024));
|