mirror of
https://github.com/hmalik144/Farmr.git
synced 2025-12-10 02:25:19 +00:00
Merge pull request #40 from hmalik144/rounding_bug_fix
Rounding bug fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.appttude.h_mal.farmr.utils
|
||||
|
||||
import java.io.IOException
|
||||
import java.math.RoundingMode
|
||||
import java.text.NumberFormat
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
@@ -26,7 +27,7 @@ fun Float.formatAsCurrencyString(): String? {
|
||||
}
|
||||
|
||||
fun Float.formatToTwoDpString(): String {
|
||||
return toBigDecimal().setScale(2).toString()
|
||||
return toBigDecimal().setScale(2, RoundingMode.HALF_DOWN).toString()
|
||||
}
|
||||
|
||||
fun String.dateStringIsValid(): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user