Dividing any number using the "/" math block thing *ALWAYS* rounds down the number.

Started by RedWirePlatinum on

Topic category: Troubleshooting, bugs, and solutions

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Dividing any number using the "/" math block thing *ALWAYS* rounds down the number.

I made a progress bar for my mod that has 7 different images that appears like the furnace fire when smelting. I noticed when you try to do something like "6/7" (returns 0) or "9/7" (returns 1) that it ALWAYS rounds down the number. Please *don't* round down numbers when dividing, it's very annoying. If I wanted to round down the result, I'd use the "round down" math block.

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The answer to this is to…
Wed, 04/05/2023 - 23:52

The answer to this is to type out the actual number (ex: 6/7 is ~0.85). Still annoying, as I said.

Joined Aug 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This depends on which type…
Thu, 04/06/2023 - 02:19

This depends on which type of variables is used. For example, if you have an int variable, you can not use decimal numbers with them as they are not supported. However, if you use a float or a double variable, it will support them as they are made for that.

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I see. How would I use float…
Thu, 04/06/2023 - 04:14

I see. How would I use float or double variables then?

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Still kinda waiting for a…
Thu, 04/06/2023 - 04:35

Still kinda waiting for a response, but i found a way to make this work as intended, probably not *the* way but still

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Slight update: Trying to do …
Thu, 04/06/2023 - 04:48

Slight update: Trying to do "7.0" just makes the number 7, so that doesn't help

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(For the regular number…
Thu, 04/06/2023 - 04:48

(For the regular number thing)

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Until I get a response from…
Thu, 04/06/2023 - 04:55

Until I get a response from Goldorion, here's another alternate solution

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay so you just have to…
Thu, 04/06/2023 - 05:06

Okay so you just have to make at least *one* number have a decimal instead of both

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Still waiting for a response…
Fri, 04/07/2023 - 08:02

Still waiting for a response >:(((((((

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here's a 3rd alternative (do…
Fri, 04/07/2023 - 20:02

Here's a 3rd alternative (do NOT use "random integer between")

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i just entered the text…
Wed, 11/22/2023 - 19:18

i just entered the text editor thing and changed the 7 to 7.0