Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

[Feature] Added Decimal Formatting Capability #3568

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

shamim-emon
Copy link
Member

@shamim-emon shamim-emon commented Sep 29, 2024

Pull request (PR) checklist

Please check if your pull request fulfills the following requirements:

  • I've read the Contribution Guidelines and my PR doesn't break the rules.
  • I've read and understand the Developer Guidelines.
  • I confirm that I've run the code locally and everything works as expected.
  • My PR includes only the necessary changes to fix the issue (i.e., no unnecessary files or lines of code are changed).
  • 🎬 I've attached a screen recording of using the new code to the next paragraph (if applicable).

Screen recording of your changes (if applicable):

What's changed?

Describe with a few bullets what's new:

  • I've added Decimal Formatting Capabilities

Risk factors

What may go wrong if we merge your PR?
-N/A

In what cases won't your code work?
-N/A

Does this PR close any GitHub issues? (do not delete)

Troubleshooting GitHub Actions (CI) failures ❌

Pull request checks failing? Read our CI Troubleshooting guide.

@shamim-emon shamim-emon mentioned this pull request Sep 29, 2024
3 tasks
@ILIYANGERMANOV
Copy link
Collaborator

@shamim-emon it's your Android Studio, all tests are passing on the CI. Sometimes Android Studio habe an incorrect run configuration and that's why it cannot run the test. Try running the test by clicking the play button on the entire package or the tesr class

@shamim-emon
Copy link
Member Author

@ILIYANGERMANOV
Decimal format should handle the rest. To unit test this you must set the locale to EN and IM and create tests for both. In that case, you might explicitly pass Locale to the decimalformat via DevicePreferences or whatever was the class for getting the locals that I created

Not sure if I got you right. In FormatMoneyUseCase I used the DevicePreferences . Let me know your comment on it. In unit test we can pass return Locale.English and/or other as per our need, like{ devicePreferences.locale() } returns Locale.ENGLISH.

my current unit test is failing with below error

Execution failed for task ':shared:ui:core:testDebugUnitTest'.
> No tests found for given includes: [com.ivy.ui.FormatMoneyUseCaseTest.Format with no decimal place locale ENGLISH](--tests filter)

I'm a little unsure about the underlying cause here. If possible give me some suggestion around it.

@ILIYANGERMANOV ILIYANGERMANOV requested a review from a team September 29, 2024 16:18
@shamim-emon shamim-emon marked this pull request as draft September 30, 2024 06:48
@shamim-emon shamim-emon changed the title Under dev [Feature] Added Decimal Formatting Capability Sep 30, 2024
@shamim-emon shamim-emon marked this pull request as ready for review September 30, 2024 11:47
@shamim-emon
Copy link
Member Author

shamim-emon commented Sep 30, 2024

@shamim-emon
Copy link
Member Author

@ILIYANGERMANOV I have resolved all reviews. Please let me know if anything else needed. Thanks

Copy link
Collaborator

@ILIYANGERMANOV ILIYANGERMANOV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 💯

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decimal number
2 participants