BirthdayResearch / defichain-wallet

DeFiChain Wallet. The DeFi Blockchain Light Wallet for iOS, Android & Web.
MIT License
125 stars 46 forks source link

fix(core): fix decimal value turning into exponential notation string #4094

Closed lykalabrada closed 10 months ago

lykalabrada commented 10 months ago

What this PR does / why we need it:

Properly convert amount into a string-number. BigNumber stores big decimals as exponential notation 0.00000005 into 5e-8

Which issue(s) does this PR fixes?:

Fixes DFC-372

Additional comments?:

Developer Checklist:

linear[bot] commented 10 months ago
DFC-372 Transfer Domain : Invalid decimal value error while performing convert using 8 decimals

#### What happened? Invalid decimal value error while performing convert (Quick links) using 8 decimals #### What did you expect to happen? #### How to reproduce it (as minimally and precisely as possible): 1. User is in DVM network 2. Click on convert from the quick links 3. select DFI → DFI EVM 4. Input amount 0.00000005 #### Anything else that the team needs to know? [Invalid_decimal_value_error.PNG](https://uploads.linear.app/ed7438a1-0dae-40df-9d75-9ba5b0ba89d2/be226168-16a4-40f7-b55c-c7e730726068/44703f37-50bb-4333-b69a-403b6fcaecc5) [Invalid_decimal_value_error.MP4](https://uploads.linear.app/ed7438a1-0dae-40df-9d75-9ba5b0ba89d2/2bc9e538-6201-4eab-a484-03c944b454e5/1c141966-7b19-4953-a6f3-6556ce5e213e)

github-actions[bot] commented 10 months ago

Missing Translations Report

The following translations are missing for this pull request.

{
    "missingLanguageItems": {
        "zh-Hans": {
            "missingCount": 0,
            "labels": {},
            "totalCount": 2028,
            "allLabels": "{}"
        },
        "zh-Hant": {
            "missingCount": 0,
            "labels": {},
            "totalCount": 2028,
            "allLabels": "{}"
        },
        "fr": {
            "missingCount": 0,
            "labels": {},
            "totalCount": 2028,
            "allLabels": "{}"
        },
        "es": {
            "missingCount": 0,
            "labels": {},
            "totalCount": 2028,
            "allLabels": "{}"
        },
        "it": {
            "missingCount": 0,
            "labels": {},
            "totalCount": 2028,
            "allLabels": "{}"
        }
    },
    "totalMissingCount": 0
}
github-actions[bot] commented 10 months ago

Build preview for DeFiChain Wallet is ready!

Built with commit aa84c4adc0afa952e7bf0d274a7b7a3448f84601

https://expo.io/@defichain/wallet?release-channel=pr-preview-4094