foreground.js
// get number right of the dot length
get number right of the dot length
get number right of the dot length
function countDecimals(value) {
  if(Math.floor(value) === value) return 0;
  const arr = value.toString().split(".");
  return (arr.length > 1) ? arr[1].length : 0; 
}
function countDecimals ( value ) { if ( Math . floor ( value ) === value ) return 0 ; const arr = value . toString ( ) . split ( "." ) ; return ( arr . length > 1 ) ? arr [ 1 ] . length : 0 ; }
get number right of the dot length
get number right of the dot length