-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathConstants.swift
More file actions
30 lines (22 loc) · 1.01 KB
/
Constants.swift
File metadata and controls
30 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//=----------------------------------------------------------------------------=
// This source file is part of the DiffableTextViews open source project.
//
// Copyright (c) 2022 Oscar Byström Ericsson
// Licensed under Apache License, Version 2.0
//
// See http://www.apache.org/licenses/LICENSE-2.0 for license information.
//=----------------------------------------------------------------------------=
import DiffableTextKitXNumber
import Foundation
//*============================================================================*
// MARK: * Constants
//*============================================================================*
let USD: String = "USD"
let en_US: Locale = Locale(identifier: "en_US")
let currencyCodes: [String] = Locale
.isoCurrencyCodes
let locales: [Locale] = Locale
.availableIdentifiers.lazy.map(Locale.init)
.sorted(by: { $0.identifier < $1.identifier })
let numbers: [NumberTextStyle<Decimal>.Cache] = locales.lazy
.map(NumberTextStyle<Decimal>.init).map({ $0.cache() })