Skip to content
0

katanakit-js / useToKilos

Function: useToKilos() ​

ts
function useToKilos(
   pounds, 
   locale?, 
   digits?
): string;

Defined in: src/core/services/formatter.service.ts:319

Pure: pounds → kilograms (formatted).

Parameters ​

ParameterTypeDefault valueDescription
poundsnumberundefinedWeight in pounds.
locale"en" | "es" | "fr" | "de" | "it" | "pt" | "ja" | "zh""en"BCP 47 locale tag. Defaults to "en".
digitsnumber2Fraction digits. Defaults to 2.

Returns ​

string

The formatted kilogram string.

Example ​

ts
import { useToKilos } from "katanakit-js";

useToKilos(1); // "0.45"

Released under the MIT License.