diff --git a/src/js/components/Timer.tsx b/src/js/components/Timer.tsx index b216ef38b..bbbb02f0f 100644 --- a/src/js/components/Timer.tsx +++ b/src/js/components/Timer.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import * as Quran from 'lib/Quran'; -import { numberToDecimal } from 'lib/i18n'; +import { formatNumber } from 'lib/i18n'; interface Props { surah: Quran.Surah @@ -25,7 +25,7 @@ export function Timer ({ surah, stream, setStream, locale, isPaused }: Props) { }, [ms, isPaused]); return (
- {numberToDecimal(ms / 1000, locale)} + {formatNumber(ms / 1000, locale)}
); } diff --git a/src/js/lib/i18n.ts b/src/js/lib/i18n.ts index 936b0001a..07597b248 100644 --- a/src/js/lib/i18n.ts +++ b/src/js/lib/i18n.ts @@ -33,7 +33,7 @@ export function i18n(json: string): TFunction { }; } -export function numberToDecimal(number: number, locale: Quran.Locale): string { +export function formatNumber(number: number, locale: Quran.Locale): string { return number.toLocaleString(locale, { maximumFractionDigits: 1 }) .split(/([^\d])/) .join(' ');