@flywire/react-headlessui
Advanced tools
Comparing version 0.0.13-4 to 0.0.13-5
@@ -93,3 +93,3 @@ "use strict"; | ||
}; | ||
return (0, money_1.toMoney)((0, money_1.toNumber)(value.toString(), options), options); | ||
return (0, money_1.toMoney)(typeof value === 'string' ? (0, money_1.toNumber)(value.toString(), options) : value, options); | ||
} | ||
@@ -102,3 +102,2 @@ return (0, utils_1.formatNumber)((0, utils_1.parseNumber)(value), { decimals }); | ||
decimal: decimalMark, | ||
subunitToUnit, | ||
}) | ||
@@ -105,0 +104,0 @@ : (0, utils_1.parseNumber)(value); |
@@ -10,4 +10,6 @@ declare type FormatOptions = { | ||
declare const toMoney: (number: number, options?: FormatOptions) => string; | ||
declare const toNumber: (number: string, options?: Pick<FormatOptions, 'decimal' | 'subunitToUnit'>) => number; | ||
declare const toNumber: (number: string, options?: { | ||
decimal?: string; | ||
}) => number; | ||
export { toNumber, toMoney }; | ||
//# sourceMappingURL=money.d.ts.map |
@@ -68,3 +68,3 @@ import { useEffect, useState, } from 'react'; | ||
}; | ||
return toMoney(toNumber(value.toString(), options), options); | ||
return toMoney(typeof value === 'string' ? toNumber(value.toString(), options) : value, options); | ||
} | ||
@@ -77,3 +77,2 @@ return formatNumber(parseNumber(value), { decimals }); | ||
decimal: decimalMark, | ||
subunitToUnit, | ||
}) | ||
@@ -80,0 +79,0 @@ : parseNumber(value); |
@@ -10,4 +10,6 @@ declare type FormatOptions = { | ||
declare const toMoney: (number: number, options?: FormatOptions) => string; | ||
declare const toNumber: (number: string, options?: Pick<FormatOptions, 'decimal' | 'subunitToUnit'>) => number; | ||
declare const toNumber: (number: string, options?: { | ||
decimal?: string; | ||
}) => number; | ||
export { toNumber, toMoney }; | ||
//# sourceMappingURL=money.d.ts.map |
@@ -102,3 +102,3 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
}; | ||
return (0, money_1.toMoney)((0, money_1.toNumber)(value.toString(), options), options); | ||
return (0, money_1.toMoney)(typeof value === 'string' ? (0, money_1.toNumber)(value.toString(), options) : value, options); | ||
} | ||
@@ -111,3 +111,2 @@ return (0, utils_1.formatNumber)((0, utils_1.parseNumber)(value), { decimals }); | ||
decimal: decimalMark, | ||
subunitToUnit, | ||
}) | ||
@@ -114,0 +113,0 @@ : (0, utils_1.parseNumber)(value); |
@@ -10,4 +10,6 @@ declare type FormatOptions = { | ||
declare const toMoney: (number: number, options?: FormatOptions) => string; | ||
declare const toNumber: (number: string, options?: Pick<FormatOptions, 'decimal' | 'subunitToUnit'>) => number; | ||
declare const toNumber: (number: string, options?: { | ||
decimal?: string; | ||
}) => number; | ||
export { toNumber, toMoney }; | ||
//# sourceMappingURL=money.d.ts.map |
{ | ||
"name": "@flywire/react-headlessui", | ||
"version": "0.0.13-4", | ||
"version": "0.0.13-5", | ||
"description": "Headless UI components", | ||
@@ -5,0 +5,0 @@ "main": "./dist/umd/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5193
320622