Start of main content## More like this

Checks if a number has any decimals digits

- Use the modulo (
`%`

) operator to check if the number is divisible by`1`

and return the result.

`const hasDecimals = num => num % 1 !== 0;`

```
hasDecimals(1); // false
hasDecimals(1.001); // true
```

### Luhn check

JavaScript, Math

Implements the Luhn Algorithm, used to validate a variety of identification numbers.

### Digitize number

JavaScript, Math

Converts a number to an array of digits, removing its sign if necessary.

### Number to fixed-point notation without trailing zeros

JavaScript, Math

Formats a number using fixed-point notation, if it has decimals.