-
Notifications
You must be signed in to change notification settings - Fork 16
DTSERWFOUR-461-Update decimal places for FX #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DTSERWFOUR-461-Update decimal places for FX #253
Conversation
commonui/src/main/java/com/hyperwallet/android/ui/common/util/CurrencyParser.java
Outdated
Show resolved
Hide resolved
transferui/src/androidTest/java/com/hyperwallet/android/ui/transfer/TransferUserFundsTest.java
Show resolved
Hide resolved
commonui/src/main/java/com/hyperwallet/android/ui/common/util/CurrencyParser.java
Outdated
Show resolved
Hide resolved
rbanikPP
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review comments are acted upon
| return null; | ||
| } | ||
|
|
||
| public static String getRateWithFourDecimal(String rate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- number of decimal places should be a parameter, why hard code?
- Method name should be generic enough, we could use this method to format any amount for any number of decimal places then instead of just Rate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to generic method
| public static String getRateWithFourDecimal(String rate) { | ||
| if (rate != null) { | ||
| StringBuilder builder = new StringBuilder(); | ||
| String[] amount = rate.split("\\."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use string manipulation? Parsing to double isn't working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NumberFormat/Decimal formate rounding the value 1.0000 as 1 , i.e used string manipulation iOS also implemented the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once we parse the value to double and truncate , its formatted and rounding the value eg: 1.000056 its return as 1. not as 1.0000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brandon confirm implement the round up for FX as a new ticket for IOS and android
commonui/src/main/java/com/hyperwallet/android/ui/common/util/CurrencyParser.java
Show resolved
Hide resolved
| decimalLength = value.substring(value.indexOf(".")).length(); | ||
| } | ||
| if (decimalLength > noOfDecimals) { | ||
| returnValue = value.substring(0, value.indexOf(".") + noOfDecimals + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong implementation, when we are reducing number of decimal places, we can't just truncate the decimals, we either round up or round down values.
Please check in the grooming recording or ask Brandon, as far as I remember we round up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brandon, conformed only truncating the last two decimals not round up the value.
| public static String getRateWithFourDecimal(String rate) { | ||
| if (rate != null) { | ||
| StringBuilder builder = new StringBuilder(); | ||
| String[] amount = rate.split("\\."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public static String getRateWithFourDecimal(String rate) { | ||
| StringBuilder builder = new StringBuilder(); | ||
| String[] amount = rate.split("\\."); | ||
| if(amount.length == 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commonui/src/main/java/com/hyperwallet/android/ui/common/util/CurrencyParser.java
Show resolved
Hide resolved
vwagh-hw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving for now, but as discussed the implementation using strings should change and be based on double with rounded values in next ticket
* DTSERWFOUR-463-Allow Transaction Details text to be selected (#254) * DTSERWFOUR-463-Allow Transaction Details text to be selected * Address review comments * Address review comments * UIcase for Allow Transaction details text to be selected Co-authored-by: Naren <najayaraman@paypal.com> * DTSERWFOUR-461-Update decimal places for FX (#253) * DTSERWFOUR-461-Update decimal places for FX * address review comments * address review comments * update unit test. * Address review comments * Address review comments * Address review comments * Fix info overlap on smaller screens. * Fix info overlap on smaller screens. Co-authored-by: Naren <najayaraman@paypal.com>
|
How I did collect my payment
…On Mon, Mar 29, 2021, 10:58 AM Vikas Wagh ***@***.***> wrote:
Merged #253
<#253> into
S206.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AP3MVUOJOZ5MSD4LXAWSR33TGCIRXANCNFSM4ZKRXLZA>
.
|

No description provided.