Skip to content

Commit 1f07623

Browse files
committed
post merge adjustments
1 parent 0af95ef commit 1f07623

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Packages/Sequence-Unity/Sequence/SequenceBoilerplates/Scripts/PlayerProfile/SequencePlayerProfile.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ public async void Show(IWallet wallet, Chain chain, Action onClose = null)
5959
var indexer = new ChainIndexer(_chain);
6060
var balanceResponse = await indexer.GetNativeTokenBalance(walletAddress);
6161

62-
var balance = DecimalNormalizer.ReturnToNormalString(balanceResponse.balanceWei);
63-
_etherBalanceText.text = $"{balance} ETH";
64-
SetBalance(balance);
62+
SetBalance(balanceResponse.balanceWei);
6563
_messagePopup.gameObject.SetActive(false);
6664
EnableLoading(false);
6765

@@ -172,7 +170,9 @@ private async void UnlinkWallet(LinkedWalletData wallet)
172170

173171
private void SetBalance(BigInteger amount)
174172
{
175-
_etherBalanceText.text = $"{amount} {ChainDictionaries.GasCurrencyOf[_chain]}";
173+
var decimals = DecimalNormalizer.ReturnToNormalString(amount);
174+
var symbol = ChainDictionaries.GasCurrencyOf[_chain];
175+
_etherBalanceText.text = $"{decimals} {symbol}";
176176
}
177177
}
178178
}

Packages/Sequence-Unity/Sequence/SequenceSDK/Utils/DecimalNormalizer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Globalization;
23
using System.Numerics;
34
using UnityEngine;
45

@@ -82,7 +83,7 @@ public static float ReturnToNormal(BigInteger x, int decimals = 18)
8283
/// <returns></returns>
8384
public static decimal ReturnToNormalPrecise(BigInteger x, int decimals = 18)
8485
{
85-
return decimal.Parse(ReturnToNormalString(x, decimals));
86+
return decimal.Parse(ReturnToNormalString(x, decimals), CultureInfo.InvariantCulture);
8687
}
8788
}
8889
}

0 commit comments

Comments
 (0)