Skip to content

Latest commit

 

History

History
26 lines (15 loc) · 962 Bytes

formatUtils.md

File metadata and controls

26 lines (15 loc) · 962 Bytes

FormatUtils

The formatUtils module provides functions for formating data such as weight, speed, time, price, numbers, dates etc.

Table of Contents


formatWeight()

Description: Given a type of weight and a value it returns a string that appends the SI symbol and handles the plural/single state.

Parameters:

value: The weight value as a number

options: An object specifying formating options.

  • type: The type of weight(e.g. pounds, centigrams, kilograms etc.) you want to format.
  • locale (optional, default: "el"): The locale for the type of weight("el" for Greek, "en" for English).
  • format (optional, default: "full"): Makes the weight text short(e.g. p) or full(e.g. pound).
  • withInternational (optional): Appends the International System of Units(SI) symbol at the end(e.g. 2 pounds (lb)).

Return Type: A string.