All Downloads are FREE. Search and download functionalities are using the official Maven repository.

iosMain.tech.skot.viewmodel.CurrencyFormat.kt Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
package tech.skot.viewmodel

import platform.Foundation.NSDate

//import java.text.DecimalFormat
//import java.text.NumberFormat
//import java.util.*
//
//private val mapFromatter = mutableMapOf()
//
//actual fun Double.asPrice(isoCurrency: String) = getFormatter(isoCurrency, Locale.getDefault()).format(this)
//
//private fun getFormatter(isoCurrency: String, locale: Locale): NumberFormat {
//    val key = "${isoCurrency}_${locale.country}"
//    return mapFromatter[key] ?: DecimalFormat.getCurrencyInstance(locale).apply {
//        maximumFractionDigits = 2
//        minimumFractionDigits = 0
//        currency = Currency.getInstance(isoCurrency)
//        mapFromatter[key] = this
//    }
//}

//private val mapFromatter = mutableMapOf()

actual fun Double.asPrice(isoCurrency: String, maximumFractionDigits : Int, minimumFractionDigits : Int) = ""

//private fun getFormatter(isoCurrency: String, locale:NSLocale): NumberFormatter {
//    val key = "${isoCurrency}_${locale}"
//    return mapFromatter[key] ?: DecimalFormat.getCurrencyInstance(locale).apply {
//        maximumFractionDigits = 2
//        minimumFractionDigits = 0
//        currency = Currency.getInstance(isoCurrency)
//        mapFromatter[key] = this
//    }
//}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy