abrochard / emacs-habitica

Emacs Extension for Habitica
GNU General Public License v3.0
77 stars 23 forks source link

Fix: Habitica crashing due to fround #13

Closed larebsyed closed 5 years ago

larebsyed commented 5 years ago

14

abrochard commented 5 years ago

Thank you for your PR! Just out of curiosity, what's the difference between round and fround? Do you know why it was crashing?

larebsyed commented 5 years ago

Hey @abrochard, Thanks for looking into my PR, Following is the definition of fround I going frm elisp doc

Function: fround float

This function rounds float to the nearest integral value, and returns that value as a floating-point number. Rounding a value equidistant between two integers returns the even integer.`

As far as I think, the issue may be due to the fact tha Habitica api is returning integer and fround is expecting float.

I have used round instead which according to docs should work on any kind of number. Here is the definition I copied from docs

Function: round number &optional divisor

This returns number, converted to an integer by rounding towards the nearest integer. Rounding a value equidistant between two integers returns the even integer.

abrochard commented 5 years ago

Sound good. Thank you for explaining! I merged the PR.