diff options
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r-- | packages/instant/src/util/asset.ts | 2 | ||||
-rw-r--r-- | packages/instant/src/util/big_number_input.ts (renamed from packages/instant/src/util/big_number.ts) | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts index e42727d84..2c5b6325d 100644 --- a/packages/instant/src/util/asset.ts +++ b/packages/instant/src/util/asset.ts @@ -51,7 +51,7 @@ export const assetUtils = { if (symbol.length <= 5) { return symbol; } - return `${symbol.slice(0, 3)}...`; + return `${symbol.slice(0, 3)}…`; }, getAssociatedAssetDataIfExists: (assetData: string, network: Network): string | undefined => { const assetDataGroupIfExists = _.find(assetDataNetworkMapping, value => value[network] === assetData); diff --git a/packages/instant/src/util/big_number.ts b/packages/instant/src/util/big_number_input.ts index a34d22d76..d2a9a8dc5 100644 --- a/packages/instant/src/util/big_number.ts +++ b/packages/instant/src/util/big_number_input.ts @@ -4,24 +4,24 @@ import * as _ from 'lodash'; /** * A BigNumber extension that is more flexible about decimal strings. * Such as allowing: - * new BigNumberInput(0.) => 0 - * new BigNumberInput(1.) => 1 - * new BigNumberInput(1..) => still throws + * new BigNumberInput('0.') => 0 + * new BigNumberInput('1.') => 1 + * new BigNumberInput('1..') => still throws */ export class BigNumberInput extends BigNumber { - private readonly _hasDecimalPeriod: boolean; + private readonly _isEndingWithDecimal: boolean; constructor(bigNumberString: string) { const hasDecimalPeriod = _.endsWith(bigNumberString, '.'); let internalString = bigNumberString; if (hasDecimalPeriod) { - internalString = bigNumberString.slice(0, bigNumberString.length - 1); + internalString = bigNumberString.slice(0, -1); } super(internalString); - this._hasDecimalPeriod = hasDecimalPeriod; + this._isEndingWithDecimal = hasDecimalPeriod; } - public toString(): string { + public toDisplayString(): string { const internalString = super.toString(); - if (this._hasDecimalPeriod) { + if (this._isEndingWithDecimal) { return `${internalString}.`; } return internalString; |