Files
ccn/Services/Website/Sources/Library/Internal/Extensions/Int+Euros.swift
T

15 lines
334 B
Swift

import Foundation
extension Int {
// MARK: Computed
/// The amount of euro cents as a price: whole euros bare (`€240`), anything else to the cent (`€12.50`).
var euros: String {
isMultiple(of: 100)
? "€\(self / 100)"
: String(format: "€%d.%02d", self / 100, self % 100)
}
}