Posted 16 February 2016 - 03:12 AM
Hey all!
I am playing on the relatively new modpack Tekkit Legends and I am coding an API and a control program that uses it for the Big Reactors mod which is part of the pack. Right now the control program only functions as a remote display for my reactor, but that is where I am having trouble. I am using the computer port from big reactors to get data from the reactor itself and certain methods return float values that have an incredibly long decimal, which I would like to reduce to two decimal places because it will not fit on the monitor I am using to display the info plus it is really messy looking. So far I have tried using string.format() with little success, the values it returns are either not formatted or inconsistantly formatted to an arbitrary number of decimal points that changes nearly every time my display updates itself. If necessary I can post my API and program.
Thanks to everyone in advance!
I am playing on the relatively new modpack Tekkit Legends and I am coding an API and a control program that uses it for the Big Reactors mod which is part of the pack. Right now the control program only functions as a remote display for my reactor, but that is where I am having trouble. I am using the computer port from big reactors to get data from the reactor itself and certain methods return float values that have an incredibly long decimal, which I would like to reduce to two decimal places because it will not fit on the monitor I am using to display the info plus it is really messy looking. So far I have tried using string.format() with little success, the values it returns are either not formatted or inconsistantly formatted to an arbitrary number of decimal points that changes nearly every time my display updates itself. If necessary I can post my API and program.
Thanks to everyone in advance!