Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
histhub
wikidata-lib
Commits
8773d4c2
Commit
8773d4c2
authored
May 21, 2019
by
Tobias Steiner
Browse files
Round to six digits after a comma
parent
e6f3db67
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wiki-normalizer.ts
View file @
8773d4c2
...
...
@@ -43,8 +43,8 @@ class WikiNormalizer extends Transform {
const
data
=
Buffer
.
from
(
chunk
.
parsed
.
data
).
toString
(
'
utf8
'
);
const
obj
=
JSON
.
parse
(
data
);
// helpers
const
lat
=
this
.
getValue
(
obj
,
'
P625
'
,
'
latitude
'
);
const
lon
=
this
.
getValue
(
obj
,
'
P625
'
,
'
longitude
'
);
const
lat
=
Number
.
parseFloat
(
this
.
getValue
(
obj
,
'
P625
'
,
'
latitude
'
)
).
toFixed
(
6
)
;
const
lon
=
Number
.
parseFloat
(
this
.
getValue
(
obj
,
'
P625
'
,
'
longitude
'
)
).
toFixed
(
6
)
;
// if not coordinates ignore
if
(
!
lat
||
!
lon
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment