Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
e8f05a25
Commit
e8f05a25
authored
8 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Lat/Lon no longer formatted with fixed number of decimals
parent
a2291703
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase/lib/formatting.js
+2
-2
2 additions, 2 deletions
frontend/src/metabase/lib/formatting.js
frontend/src/metabase/lib/schema_metadata.js
+2
-0
2 additions, 0 deletions
frontend/src/metabase/lib/schema_metadata.js
with
4 additions
and
2 deletions
frontend/src/metabase/lib/formatting.js
+
2
−
2
View file @
e8f05a25
...
...
@@ -4,7 +4,7 @@ import moment from "moment";
import
Humanize
from
"
humanize
"
;
import
React
from
"
react
"
;
import
{
isDate
,
isNumber
}
from
"
metabase/lib/schema_metadata
"
;
import
{
isDate
,
isNumber
,
isCoordinate
}
from
"
metabase/lib/schema_metadata
"
;
import
{
parseTimestamp
}
from
"
metabase/lib/time
"
;
const
PRECISION_NUMBER_FORMATTER
=
d3
.
format
(
"
.2r
"
);
...
...
@@ -101,7 +101,7 @@ export function formatValue(value, options = {}) {
}
else
if
(
typeof
value
===
"
string
"
)
{
return
value
;
}
else
if
(
typeof
value
===
"
number
"
)
{
if
(
column
&&
(
column
.
special_type
===
"
latitude
"
||
column
.
special_type
===
"
longitude
"
))
{
if
(
isCoordinate
(
column
))
{
return
DECIMAL_DEGREES_FORMATTER
(
value
);
}
else
{
return
formatNumber
(
value
,
options
);
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/lib/schema_metadata.js
+
2
−
0
View file @
e8f05a25
...
...
@@ -113,6 +113,8 @@ export const isNumericBaseType = (field) => isa(field && field.base_type, TYPE.N
// ZipCode, ID, etc derive from Number but should not be formatted as numbers
export
const
isNumber
=
(
field
)
=>
(
field
.
special_type
==
null
||
field
.
special_type
===
TYPE
.
Number
);
export
const
isCoordinate
=
(
field
)
=>
isa
(
field
&&
field
.
special_type
,
TYPE
.
Coordinate
);
// operator argument constructors:
function
freeformArgument
(
field
,
table
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment