Eureka icon indicating copy to clipboard operation
Eureka copied to clipboard

Decimal row three decimal places

Open anupamchugh opened this issue 5 years ago • 2 comments

Is it possible to set more than two decimal places using the DecimalRow? Perhaps a way to set n number of characters after the dot would be good.

anupamchugh avatar Apr 25 '19 12:04 anupamchugh

You can change the formatter of the row, or change the current one

mats-claassen avatar Apr 29 '19 14:04 mats-claassen

DecimalRow.defaultCellSetup = { cell, row in let numberFormatter = NumberFormatter() numberFormatter.locale = Locale.current numberFormatter.numberStyle = .decimal numberFormatter.minimumFractionDigits = 2 numberFormatter.maximumFractionDigits = 2

        row.formatter = numberFormatter
    }

LeoAiolia avatar Apr 18 '20 02:04 LeoAiolia