I've modified the ResourceFurnitureScript in order to chop firewood until my max carry weight. I wanted to display notifications at the top right similar to Firewood Added (2)
using debug.notifications, These are Max Carry Weight, Current Carry Weight, and Remaining Firewood.
Current carry weight is currently in float form, because Skryim rounds the decimal inventory weight, for example 150.32 down to 150 and 150.56 to 151. How can I make my current inventory weight round to two decimal places?
I pulled this from stackoverflow
float val = 37.777779;float rounded_down = floor(val * 100) / 100; /* Result: 37.77 */float nearest = floor(val * 100 + 0.5) / 100; /* Result: 37.78 */float rounded_up = ceil(val * 100) / 100; /* Result: 37.78 */cout << nearest;I've tried float nearest it still shows the zeros (150.250000)
float trueInvWeight = Game.GetPlayer().GetActorValue("inventoryweight")float rounded = floor(trueInvWeight * 100 + 0.5) / 100.0debug.Notification("Current Carry Weight " + "(" + rounded + ")")
On the Creation Kit wiki, I've read about the show function and the flag section
It says to use %10.2f to round to two decimals, but I couldn't implement a show message or use it within debug.notification