timezonecomplete
Version:
DateTime, TimeZone, Duration and Period library aimed at providing a consistent and complete date-time interface, away from the original JavaScript Date class.
32 lines (31 loc) • 971 B
TypeScript
/**
* Copyright(c) 2014 ABB Switzerland Ltd.
*
* Math utility functions
*/
/**
* @return true iff given argument is an integer number
* @throws nothing
*/
export declare function isInt(n: number): boolean;
/**
* Rounds -1.5 to -2 instead of -1
* Rounds +1.5 to +2
* @throws timezonecomplete.Argument.N if n is not a finite number
*/
export declare function roundSym(n: number): number;
/**
* Stricter variant of parseFloat().
* @param value Input string
* @return the float if the string is a valid float, NaN otherwise
* @throws nothing
*/
export declare function filterFloat(value: string): number;
/**
* Modulo function that only returns a positive result, in contrast to the % operator
* @param value
* @param modulo
* @throws timezonecomplete.Argument.Value if value is not finite
* @throws timezonecomplete.Argument.Modulo if modulo is not a finite number >= 1
*/
export declare function positiveModulo(value: number, modulo: number): number;