pioneerspacesim/pioneer — pull request #2944 by impaktor (2014-06-13 14:54:21+00:00)
Title: Fixes money format overflow

__Problem:__ when converting from `double t` to `Sint64`: in `lua_pushstring(l, format_money(Sint64(t*100.0), show_cents).c_str());` we eventually get overflow .

__Solution:__ Don't convert double to int. Especially since we convert the int back to double again later. So use a double and remove fractional part with `modf` to represent an integer value of cents.

Fixes #2939

Test of a _very_ big number:
![1](https://cloud.githubusercontent.com/assets/619390/3271277/4c0f8d7a-f30a-11e3-9261-64f00bc05374.png)

Ping @lwho for comments/review?