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

Started by RedWirePlatinum on

Topic category: Troubleshooting, bugs, and solutions

Active 22 hours ago
Joined May 2022
Points:
792

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 2
  • Comments: 167
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 22 hours ago
Joined May 2022
Points:
792

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 2
  • Comments: 167
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 1 week ago
Joined Aug 2016
Points:
3304

User statistics:

  • Modifications: 9
  • Forum topics: 63
  • Wiki pages: 20
  • MCreator plugins: 11
  • Comments: 2927
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 22 hours ago
Joined May 2022
Points:
792

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 2
  • Comments: 167
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 22 hours ago
Joined May 2022
Points:
792

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 2
  • Comments: 167
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 22 hours ago
Joined May 2022
Points:
792

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 2
  • Comments: 167
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 22 hours ago
Joined May 2022
Points:
792

User statistics:

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

(For the regular number thing)

Active 22 hours ago
Joined May 2022
Points:
792

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 2
  • Comments: 167
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 22 hours ago
Joined May 2022
Points:
792

User statistics:

  • Modifications: 1
  • Forum topics: 43
  • Wiki pages: 0
  • MCreator plugins: 2
  • Comments: 167
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 22 hours ago
Joined May 2022
Points:
792

User statistics:

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

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

Active 22 hours ago
Joined May 2022
Points:
792

User statistics:

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

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

Active 1 year ago
Joined May 2023
Points:
233

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