Skip to content

Commit

Permalink
Consistent usage of default locale.
Browse files Browse the repository at this point in the history
  • Loading branch information
objecthub committed May 14, 2023
1 parent 8455028 commit 6868a02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/CLFormat/StandardDirectiveSpecifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ public enum StandardDirectiveSpecifier: DirectiveSpecifier {
let formatter = NumberFormatter()
formatter.numberStyle = .spellOut
if modifiers.contains(.plus) {
formatter.locale = arguments.locale ?? Locale(identifier: "en_US")
formatter.locale = arguments.locale ?? NumberFormat.defaultLocale
} else {
formatter.locale = Locale(identifier: "en_US")
formatter.locale = NumberFormat.defaultLocale
}
return .append(formatter.string(from: number.nsnumber) ??
String(describing: number.nsnumber))
Expand All @@ -239,7 +239,7 @@ public enum StandardDirectiveSpecifier: DirectiveSpecifier {
groupsep: nil,
groupsize: nil,
locale: modifiers.contains(.plus) ? arguments.locale
: Locale(identifier: "en_US"),
: NumberFormat.defaultLocale,
usegroup: false,
uselocale: modifiers.contains(.plus),
forcesign: false))
Expand Down

0 comments on commit 6868a02

Please sign in to comment.