Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
5261a054
Commit
5261a054
authored
Apr 30, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unit from temperature.
parent
7cb5705a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
1Weather/Extensions/Measurement+String.swift
+7
-3
No files found.
1Weather/Extensions/Measurement+String.swift
View file @
5261a054
...
...
@@ -8,11 +8,11 @@
import
Foundation
extension
Measurement
{
private
static
func
formatter
(
style
:
Formatter
.
UnitStyle
)
->
MeasurementFormatter
{
private
static
func
formatter
(
style
:
Formatter
.
UnitStyle
,
unitOptions
:
MeasurementFormatter
.
UnitOptions
=
.
providedUnit
)
->
MeasurementFormatter
{
let
fmt
=
MeasurementFormatter
()
fmt
.
locale
=
Settings
.
shared
.
locale
fmt
.
unitStyle
=
style
fmt
.
unitOptions
=
.
providedUnit
fmt
.
unitStyle
=
.
short
fmt
.
unitOptions
=
unitOptions
fmt
.
numberFormatter
.
maximumFractionDigits
=
0
return
fmt
}
...
...
@@ -38,6 +38,10 @@ extension Temperature {
var
settingsConverted
:
Measurement
{
return
self
.
converted
(
to
:
Settings
.
shared
.
temperatureType
)
}
var
shortString
:
String
{
return
Measurement
.
formatter
(
style
:
.
short
,
unitOptions
:
.
temperatureWithoutUnit
)
.
string
(
from
:
self
)
}
}
extension
WindSpeed
{
...
...
Write
Preview
Markdown
is supported
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