Skip to content
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

Feat: Improve function used to normalize numeric values #58

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

paulofph
Copy link
Member

The function being deprecated was dealing only with values from the type number. Now we need to deal with decimal values, the ones comming from getAG, that's why I'm extending the function to handle strings and return strings too.

The function being deprecated was dealing only with values from the type `number`. Now we need to deal with decimal values, the ones comming from getAG, that's why I'm extending the function to handle strings and return strings too.
${0.387676} | ${'weekly'} | ${'monthly'} | ${4} | ${1.5507}
${36.32422} | ${'yearly'} | ${'monthly'} | ${4} | ${3.027}
${24000} | ${'yearly'} | ${'Monthly'} | ${4} | ${2000}
${24000} | ${'yearly'} | ${undefined} | ${4} | ${24000}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${36.32422} | ${'yearly'} | ${'monthly'} | ${4} | ${3.027}
${24000} | ${'yearly'} | ${'Monthly'} | ${4} | ${2000}
${24000} | ${'yearly'} | ${undefined} | ${4} | ${24000}
${24000} | ${undefined} | ${'monthly'} | ${4} | ${24000}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${'1000.50'} | ${'monthly'} | ${'yearly'} | ${4} | ${'12006'}
${'12006'} | ${'yearly'} | ${'monthly'} | ${4} | ${'1000.5'}
${'159.345'} | ${'yearly'} | ${'monthly'} | ${4} | ${'13.2788'}
${'159.345'} | ${'yearly'} | ${'monthly'} | ${undefined} | ${'13.27875'}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
Copy link
Member

@alexmarqs alexmarqs left a comment

Choose a reason for hiding this comment

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

lgtm!

@paulofph paulofph merged commit 399e151 into main Feb 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants