diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2025-06-12 13:51:23 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2025-06-12 13:51:23 +0200 |
commit | 2382551d0ba1b750e6dd328dd4fd39c0c8249ca4 (patch) | |
tree | 106977737c57c12d00c492bf823eb48ed206b6c3 /main.js | |
parent | 000f1f83533a70249ee73a378bb8d14dafa1e26f (diff) |
ESLint: Fix no-loss-of-precision error.
Fixes: https://eslint.org/docs/latest/rules/no-loss-of-precision
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -2031,7 +2031,7 @@ const infoMetadataAccordions = []; d = parse_date(date2.value); break; } - const delta = (new Date().getTime() - d.getTime()) / 86_400_000.; + const delta = (new Date().getTime() - d.getTime()) / 86_400_000; let v; switch (type_choices.relative.unit[0].value) { case 'd': @@ -2440,21 +2440,21 @@ const infoMetadataAccordions = []; if (v < 1000) { opts.unit = 'm'; } else { - v /= 1000.; - v = Math.round(v*100) / 100.; + v /= 1000; + v = Math.round(v*100) / 100; opts.unit = 'km'; } } else if (opts.fn === 'area') { if (v < 10000) { opts.unit = 'm²'; } else if (v < 10000 * 10000) { - v /= 10000.; + v /= 10000; opts.unit = 'ha'; } else { - v /= 1000000.; + v /= 1000000; opts.unit = 'km²'; } - v = Math.round(v*100) / 100.; + v = Math.round(v*100) / 100; } else { v = opts.fn(v); } |