Skip to content

Commit 4f49a96

Browse files
committed
Use InvariantCulture for ToWei utility
1 parent ff277e8 commit 4f49a96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Assets/Thirdweb/Core/Scripts/Utils.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Nethereum.Signer;
1212
using Nethereum.Web3;
1313
using Newtonsoft.Json.Linq;
14+
using System.Globalization;
1415

1516
namespace Thirdweb
1617
{
@@ -65,7 +66,7 @@ public static long UnixTimeNowMs()
6566

6667
public static string ToWei(this string eth)
6768
{
68-
if (!double.TryParse(eth, out double ethDouble))
69+
if (!double.TryParse(eth, NumberStyles.Number, CultureInfo.InvariantCulture, out double ethDouble))
6970
throw new ArgumentException("Invalid eth value.");
7071
BigInteger wei = (BigInteger)(ethDouble * DECIMALS_18);
7172
return wei.ToString();

0 commit comments

Comments
 (0)