fix(admin-ui): Preserve decimal numbers when locale uses commas (#5641)
**What** - Ensure that we format numbers with `.` as the decimal separator, even when the users locale uses `,`. This changes still allows users to use comma as the decimal separator, but the transformation we use before writing to state converts the number to use a dot instead.
This commit is contained in:
committed by
GitHub
parent
a2a45b6fef
commit
c08240df3f
5
.changeset/seven-forks-knock.md
Normal file
5
.changeset/seven-forks-knock.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/admin-ui": patch
|
||||
---
|
||||
|
||||
fix(admin-ui): Resolves an issue where decimal numbers would be stripped when the locale uses commas as the decimal separator
|
||||
@@ -1830,6 +1830,7 @@ const Cell = React.forwardRef<HTMLInputElement, CellProps>(
|
||||
? formatValue({
|
||||
value: strippedValue.replace(/,/g, "."), // If the current locale uses commas as decimal separators, then we need to replace them with dots.
|
||||
decimalScale: decimalScale ?? 0,
|
||||
decimalSeparator: ".",
|
||||
disableGroupSeparators: true,
|
||||
})
|
||||
: ""
|
||||
|
||||
Reference in New Issue
Block a user