Prepare repository for merge

This commit is contained in:
Angelos Chalaris
2023-05-01 22:35:56 +03:00
parent fc4e61e6fa
commit b3ad01863a
578 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,21 @@
---
title: Number has decimal digits
type: snippet
tags: [math]
author: chalarangelo
cover: man-cup-laptop
dateModified: 2022-05-13T05:00:00-04:00
---
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.
```js
const hasDecimals = num => num % 1 !== 0;
```
```js
hasDecimals(1); // false
hasDecimals(1.001); // true
```