mirror of
https://github.com/hmalik144/Farmr.git
synced 2026-01-31 02:41:49 +00:00
- mid commit
This commit is contained in:
@@ -14,6 +14,7 @@ import com.appttude.h_mal.farmr.base.BaseRecyclerAdapter
|
||||
import com.appttude.h_mal.farmr.data.legacydb.ShiftObject
|
||||
import com.appttude.h_mal.farmr.model.ShiftType
|
||||
import com.appttude.h_mal.farmr.utils.ID
|
||||
import com.appttude.h_mal.farmr.utils.formatToTwoDp
|
||||
import com.appttude.h_mal.farmr.utils.generateView
|
||||
import com.appttude.h_mal.farmr.utils.navigateTo
|
||||
import com.appttude.h_mal.farmr.utils.navigateToFragment
|
||||
@@ -48,7 +49,7 @@ class ShiftListAdapter(
|
||||
val typeText: String = data.type
|
||||
val descriptionText: String = data.description
|
||||
val dateText: String = data.date
|
||||
val totalPayText: String = data.totalPay.toString()
|
||||
val totalPayText: String = data.totalPay.formatToTwoDp().toString()
|
||||
|
||||
descriptionTextView.text = descriptionText
|
||||
dateTextView.text = dateText
|
||||
|
||||
@@ -8,9 +8,8 @@ import java.util.Currency
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
fun String.formatToTwoDp(): Float {
|
||||
val formattedString = String.format("%.2f", this)
|
||||
return formattedString.toFloat()
|
||||
fun String.formatToTwoDp(): String {
|
||||
return String.format("%.2f", this)
|
||||
}
|
||||
|
||||
fun Float.formatToTwoDp(): Float {
|
||||
@@ -27,7 +26,7 @@ fun Float.formatAsCurrencyString(): String? {
|
||||
}
|
||||
|
||||
fun Float.formatToTwoDpString(): String {
|
||||
return formatToTwoDp().toString()
|
||||
return String.format("%.2f", this)
|
||||
}
|
||||
|
||||
fun String.dateStringIsValid(): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user