Home
Phabricator
Search
Log In
Files
F11543883
LocalizedStringKey+Extensions.swift
othman (OTHMAN ALRASHIDI)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Author
•
othman
Created
Nov 30 2023, 12:57 PM
Size
939 B
Mime Type
text/plain
Engine
blob
Format
Raw Data
Handle
7292690
Attached To
T16966: Create a Brand Brief and establish Brand Guidelines for KDE
LocalizedStringKey+Extensions.swift
View Options
/*
* SPDX-FileCopyrightText: 2021 Lucas Wang <lucas.wang@tuta.io>
* SPDX-FileCopyrightText: 2022 Claudio Cambra <claudio.cambra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
//
// LocalizedStringKey+Extensions.swift
// KDE Connect
//
// Created by Claudio Cambra on 25/5/22.
//
import
Foundation
import
SwiftUI
extension
LocalizedStringKey
.
StringInterpolation
{
mutating
func
appendInterpolation
(
percent
:
Int
)
{
if
#
available
(
iOS
15
,
*
)
{
appendInterpolation
(
Double
(
percent
)
/
100
,
format
:
.
percent
)
}
else
{
appendInterpolation
(
Double
(
percent
)
/
100
as
NSNumber
,
formatter
:
NumberFormatter
.
percentage
)
}
}
}
fileprivate
extension
NumberFormatter
{
static
let
percentage
:
NumberFormatter
=
{
let
formatter
=
NumberFormatter
()
formatter
.
numberStyle
=
.
percent
return
formatter
}()
}
•
othman
added a comment.
Nov 30 2023, 1:02 PM
Comment Actions
OSLogView.swift
3 KB
Download
OSLogEntryLogView.swift
2 KB
Download
OSLog+KDE Connect.swift
904 B
Download
OSLogManager.swift
1 KB
Download
•
othman
added a comment.
Nov 30 2023, 1:06 PM
Comment Actions
Fastfile
1 KB
Download
Snapfile
1 KB
Download
README.md
732 B
Download
SnapshotHelper.swift
11 KB
Download
Appfile
228 B
Download
Log In to Comment