Skip to content

Commit

Permalink
Update number.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Oct 23, 2024
1 parent 54d21b3 commit 5b65481
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tauri-app/src/lib/utils/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export function bigintStringToPercentage(
valueDecimals: number,
finalDecimalsDigits?: number,
): string {
const finalDecimals = finalDecimalsDigits !== undefined ? finalDecimalsDigits : valueDecimals;
const finalDecimals =
typeof finalDecimalsDigits !== 'undefined' ? finalDecimalsDigits : valueDecimals;
let valueString = formatUnits(BigInt(value) * 100n, valueDecimals);
const index = valueString.indexOf('.');
if (index > -1) {
Expand Down

0 comments on commit 5b65481

Please sign in to comment.