Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Read the faq and the divide documentation, couldn’t figure out how it handles fractional cents? Does it?


Great point, I was about to say the same.

Looks like it does lose cents and can't be used in production.

from the source:

    divide(a, b) {
      return a / b
},


Hey! You need to use the allocate method for this. It will redistribute fractional cents and return an array of Dinero objects.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: