15 lines
334 B
Swift
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)
|
|
}
|
|
|
|
}
|