Division arithmetic helper does not exists
umer-mehmood opened this issue · 6 comments
Hello, we have a use case, in which we have to divide a column with an integer value. To do that I am not able to find any arithmetic helper. There exists two for addition and multiplication, but we also have to apply division operation on a column.
Example: Select * from column1 * 1, column2 / 2 from Table
Kindly let me know if there is any way to achieve this. Thanks
Yes, if you want you can contribute and add a $div helper by yourself.
As template you could easily use the $mul helper. After adding the div directory, adding the source-file div.js with tests please run npm test and the readme will be generated automatcally after a successful test-run.
Here is the location of the mul helper:
https://github.com/planetarydev/json-sql-builder2/tree/master/sql/helpers/arithmetic/mul
sorry, I dont want to close :-) ... hm, reopend again ...
If you got further questions please let me know
You dont need access to the original repo. You can fork it and with the help of the fork you can make your PR. Here is how to do that Create PR from a fork
Thanks in advance and awaitig your PR.
done with PR #24