Skip to content

Commit

Permalink
[SDK] fix: Handle comma decimal input in PayEmbed (#6386)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquim-verges authored Mar 3, 2025
1 parent 323e9d7 commit c3b90a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-animals-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Handle comma for decimal input in PayEmbed
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ function SelectedTokenInfo(props: {
onChange={(e) => {
let value = e.target.value;

// Replace comma with period if it exists
value = value.replace(",", ".");

if (value.startsWith(".")) {
value = `0${value}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export function BuyTokenInput(props: {
onChange={(e) => {
let value = e.target.value;

// Replace comma with period if it exists
value = value.replace(",", ".");

if (value.startsWith(".")) {
value = `0${value}`;
}
Expand Down

0 comments on commit c3b90a6

Please sign in to comment.