//
//  Int+Ex.swift
//  TSLiveWallpaper
//
//  Created by 100Years on 2024/12/20.
//

extension Int {
    var localNumber: String? {
        return localNumber()
    }
    
    func localNumber(_ minimumIntegerDigits: Int? = nil, locale: Locale? = nil) -> String? {
        let formatter = NumberFormatter()
        if let locale = locale {
            formatter.locale = locale
        }
        else {
            formatter.locale = Locale.local
        }
        
        formatter.numberStyle = .decimal
        if let value = minimumIntegerDigits {
            formatter.minimumIntegerDigits = value
        }
        return formatter.string(for: self);
    }
}
extension Locale {
    static var local: Locale {
        return Locale(identifier: TSConfig.appLanguage)
    }
}
