From 46729371356b776c8da2b0cf0699e4db1647d25c Mon Sep 17 00:00:00 2001 From: Matthias Zenger Date: Tue, 30 May 2023 00:55:58 +0200 Subject: [PATCH] Fix compilation for iOS. --- Sources/CLFormat/NumberFormat.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/CLFormat/NumberFormat.swift b/Sources/CLFormat/NumberFormat.swift index ce6acb5..4cb04b7 100644 --- a/Sources/CLFormat/NumberFormat.swift +++ b/Sources/CLFormat/NumberFormat.swift @@ -153,7 +153,9 @@ public struct NumberFormat { formatter.locale = locale ?? NumberFormat.currentLocale } else if usegroup { formatter.locale = NumberFormat.defaultLocale + #if os(macOS) formatter.localizesFormat = false + #endif } formatter.usesGroupingSeparator = usegroup var str = formatter.string(from: number.nsnumber) ?? number.description @@ -213,7 +215,9 @@ public struct NumberFormat { formatter.locale = locale ?? NumberFormat.currentLocale } else if usegroup { formatter.locale = NumberFormat.defaultLocale + #if os(macOS) formatter.localizesFormat = false + #endif } if let groupsep = groupsep { formatter.groupingSeparator = String(groupsep) @@ -256,7 +260,9 @@ public struct NumberFormat { if uselocale { formatter.locale = locale ?? NumberFormat.currentLocale } else if usegroup { + #if os(macOS) formatter.localizesFormat = false + #endif } else if style == .ordinal { formatter.locale = locale ?? NumberFormat.defaultLocale }