view GeoQuiz/Components/FormatterExtension.swift @ 13:bdfff35dd43c

implement RevenueCat
author Dennis C. M. <dennis@denniscm.com>
date Wed, 12 Oct 2022 11:47:29 +0200
parents a793f33f05fb
children
line wrap: on
line source

//
//  Formatters.swift
//  GeoQuiz
//
//  Created by Dennis Concepción Martín on 8/10/22.
//

import Foundation

extension Formatter {
    static let withSeparator: NumberFormatter = {
        let formatter = NumberFormatter()
        formatter.numberStyle = .decimal
        return formatter
    }()
}

extension Int {
    var formattedWithSeparator: String {
        return Formatter.withSeparator.string(for: self) ?? ""
    }
}