Skip to content

Commit dc65b44

Browse files
author
le-xuan-quynh
committed
fix bugs
1 parent 2b37c82 commit dc65b44

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

Sources/VNDTextField/Constant.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ import Foundation
99
import UIKit
1010
//uppercase
1111
struct Constant {
12-
static var PRICE_LOCATION = "vn_VN"
13-
static var symbolUppercase = false
12+
static var PRICE_LOCATION = "vn_VN"
1413
}

Sources/VNDTextField/VNDTextField.swift

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,7 @@ public class VNDTextField: UITextField {
112112
self.button3.layer.cornerRadius = cornerRadius
113113
self.buttonNeedDisplay()
114114
}
115-
116-
/// Set symboy
117-
/// - Parameter symbolUppercase: symbol upcase or not
118-
public func setSymbol(symbolUppercase: Bool) {
119-
Constant.symbolUppercase = symbolUppercase
120-
}
121-
115+
122116
private func buttonNeedDisplay() {
123117
self.button1.setNeedsDisplay()
124118
self.button2.setNeedsDisplay()
@@ -179,7 +173,7 @@ public class VNDTextField: UITextField {
179173
}
180174

181175
// remove "đ" from text in textfield
182-
let charecterDeleted = Constant.symbolUppercase ? "Đ" : "đ"
176+
let charecterDeleted = "đ"
183177
inputText.removeAll(where: { charecterDeleted.contains($0) })
184178

185179
// remove "." from text in textfield
@@ -253,7 +247,7 @@ public class VNDTextField: UITextField {
253247
/// - Returns: type currency
254248
private func formatCurrency(_ inputNumber: Int) -> String {
255249
let formatter = NumberFormatter()
256-
formatter.currencySymbol = Constant.symbolUppercase ? "Đ" : "đ"
250+
formatter.currencySymbol = "đ"
257251
formatter.currencyGroupingSeparator = "."
258252
formatter.locale = Locale(identifier: Constant.PRICE_LOCATION)
259253
formatter.positiveFormat = "#,##0 ¤"

0 commit comments

Comments
 (0)