Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/main/java/com/example/inventory/AddItemFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import androidx.navigation.fragment.findNavController
import androidx.navigation.fragment.navArgs
import com.example.inventory.data.Item
import com.example.inventory.databinding.FragmentAddItemBinding
import java.util.Locale

/**
* Fragment to add or update an item in the Inventory database.
Expand Down Expand Up @@ -76,7 +77,7 @@ class AddItemFragment : Fragment() {
* Binds views with the passed in [item] information.
*/
private fun bind(item: Item) {
val price = "%.2f".format(item.itemPrice)
val price = "%.2f".format(Locale.US, item.itemPrice)
binding.apply {
itemName.setText(item.itemName, TextView.BufferType.SPANNABLE)
itemPrice.setText(price, TextView.BufferType.SPANNABLE)
Expand Down