satisfactory-factories / application

A tool to visualise groupings of factories to create a true Modular Factory setup for the game Satisfactory.
https://satisfactory-factories.app
GNU Affero General Public License v3.0
25 stars 5 forks source link

Inputs show with lots of decimal places #54

Open samsmithnz opened 1 week ago

samsmithnz commented 1 week ago

Technically correct, but ugly. Should show with 2-3 decimal places:

Image

@Maelstromeous - technical/Vue question: How do you format inputs? If I wrap the input with formatNumber, Vue doesn't like it

        <v-text-field
          v-model.number="formatNumber(input.amount)"
          class="mr-3"
          :disabled="!input.outputPart"
          hide-details
          label="Qty /min"
          max-width="110px"
          type="number"
          variant="outlined"
          @input="updateFactory(factory)"
        />

Image

If I try to wrap the input further down in JS, it doesn't seem to apply.

Maelstromeous commented 1 week ago

So you'd have to create a method within the component that the vue template can run against. If you were going to do this I'd add a globally registered component and import it possibly.

I'm wondering though how this quantity became a reality? The number is usually user entered, something shouldn't be entering it unless it's trimmed?

samsmithnz commented 1 week ago

It was a calculation when I pressed the 'fix production' button. It's likely a downstream issue from where I removed all the GetFixed() functions from the code and moved them to the HTML.

Maelstromeous commented 1 week ago

This has unfortunately has created #102, which needs fixing pronto :-/