Joshimello / AL2Lab

Calculator for factory game Assembly Line 2
https://al2lab.vercel.app
0 stars 2 forks source link

Small bug for decimal amounts of a certain item in Data tab #2

Closed DatHaker123 closed 11 months ago

DatHaker123 commented 11 months ago

I'm using 1x Nuclear Core here with default settings

image

The number of starters do not add up to the right number. Alternatively, with 2x Nuclear Core, same settings,

image

Things add up.

I tried with a few other random things and the same thing happens.

I'm gonna go ahead and guess it has something to do with Math.ceil() in src/routes/al2/stores.ts

Joshimello commented 11 months ago

Yeap, its due to the Math.ceil I added, my original thought was, since machines can only select one type output, e.g. 1.5 gold, 1.5 copper, I'd need 2 starters for gold and 2 starters for copper, instead of having a starter share the 0.5 gold with the 0.5 copper. But does it make it more complicated? Maybe add bracket number for ceiled number? e.g. 177.5 (178) Copper

Joshimello commented 11 months ago

made a preview https://al2lab-git-test-joshimello.vercel.app?_vercel_share=WSmAK31Fv2nIe2wenRynaD486Hvob7UL

DatHaker123 commented 11 months ago

I completely understand reasoning for applying ceiling, I'd have done the same. However, per the first picture, rounding up,

194 +309 + 178 + 15 + 8 = 704, not 708 as displayed

Joshimello commented 11 months ago

Ah! Understood the issue, my bad haha. Fixed d3af475