# unicorn/no-zero-fractions

> Disallow numbers with a zero fraction or a dangling dot

`1.0`, `1.` and `1` are the same number. JavaScript has no separate integer and float types, so the extra zeros and the dot suggest a difference that isn't there.

`--fix` removes the zeros and the dot.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"unicorn/no-zero-fractions" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad {"count": 4} */}
```js
const scale = 1.0;
const opacity = 0.50;
const total = 10.;
const limit = 2.0e3;
```

Not reported:

{/* good */}
```js
const scale = 1;
const opacity = 0.5;
const total = 10;
const limit = 2e3;
```
