mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-20 03:42:10 +03:00
12 lines
189 B
JavaScript
12 lines
189 B
JavaScript
export const countDecimals = (value) => {
|
|
if (!value) {
|
|
return 0;
|
|
}
|
|
|
|
if (Math.floor(value) === value) {
|
|
return 0;
|
|
}
|
|
|
|
return value.toString().split('.')[1].length || 0;
|
|
};
|