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

Started by RedWirePlatinum on

Topic category: Troubleshooting, bugs, and solutions

Active 1 hour ago
Joined May 2022
Points:
660

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 1
  • Comments: 138
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.

Active 1 hour ago
Joined May 2022
Points:
660

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 1
  • Comments: 138
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.

Active 2 hours ago
Joined Aug 2016
Points:
3302

User statistics:

  • Modifications: 9
  • Forum topics: 63
  • Wiki pages: 20
  • MCreator plugins: 11
  • Comments: 2932
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.

Active 1 hour ago
Joined May 2022
Points:
660

User statistics:

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

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

Active 1 hour ago
Joined May 2022
Points:
660

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 1
  • Comments: 138
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

Active 1 hour ago
Joined May 2022
Points:
660

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 1
  • Comments: 138
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

Active 1 hour ago
Joined May 2022
Points:
660

User statistics:

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

(For the regular number thing)

Active 1 hour ago
Joined May 2022
Points:
660

User statistics:

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

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

Active 1 hour ago
Joined May 2022
Points:
660

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 1
  • Comments: 138
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

Active 1 hour ago
Joined May 2022
Points:
660

User statistics:

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

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

Active 1 hour ago
Joined May 2022
Points:
660

User statistics:

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

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

Active 6 months ago
Joined May 2023
Points:
160

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
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