Skip to content

avoid string operations on numbers#47

Open
shaydo-deriv wants to merge 1 commit intoderiv-com:masterfrom
shaydo-deriv:fix/use-looks-like-number
Open

avoid string operations on numbers#47
shaydo-deriv wants to merge 1 commit intoderiv-com:masterfrom
shaydo-deriv:fix/use-looks-like-number

Conversation

@shaydo-deriv
Copy link

multiple methods use regex to check if input argument is a number, this is rather inefficient and to add to that if it is not a number, these methods simply return unchanged input value without indicating an error in any way.

_round_to_precision method in addition to that converts $precision value to a string for the sake of rounding it, prepends it with "-" and then parses the result back to number. This logic is hard to understand and it is also not very efficient.

multiple methods use regex to check if input argument is a number, this
is rather inefficient and to add to that if it is not a number, these
methods simply return unchanged input value without indicating an error
in any way.

_round_to_precision method in addition to that converts $precision value
to a string for the sake of rounding it, prepends it with "-" and then
parses the result back to number. This logic is hard to understand and
it is also not very efficient.
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.

1 participant