mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix slider rounding
This commit is contained in:
parent
2946ed4e35
commit
9e8c7d788a
2 changed files with 25 additions and 1 deletions
|
@ -32,3 +32,16 @@ export function toPercent(value: number | null | undefined, locale: string): str
|
|||
|
||||
return `${Math.round(value * 100)}%`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets decimal count of a Number.
|
||||
* @param {number} value Number.
|
||||
* @returns {number} Decimal count of a Number.
|
||||
*/
|
||||
export function decimalCount(value: number): number {
|
||||
if (Number.isInteger(value)) return 0;
|
||||
|
||||
const arr = value.toString().split('.');
|
||||
|
||||
return arr[1].length;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue