How do i get a certain part of a calculation

so trying to split a number from divide
ie 364/118 = 3.0847
i need to get the 3 for one thing and .0847 for another

Quotient and remainder?

the wat now? and a remainder yes

Look through the math blocks.

Some of them have pulldowns hiding more flavors.

I like floor too.

You might have to do this in two steps, division then subtracting the floor of the result to get the fractional part.

ill give that a try, doesnt help that since eng is my second language i need to stop n figure out what half of these actually do lol

image

2 Likes

used floor and quotient of to get what i wanted, thx (ps how u get those "do it" things.. need companion app/emulator active?)

Run your project in companion app, then right click on a block to return Do It

Might be better to use quotient instead of floor, may be more reliable.

1 Like

Test with negative numbers too

if used for the correct purpose the calculations should never run into the negatives so not really a worry i have but thx for reminding. i should probably atleast add an error screen or sumthing just incase.

thx again.
clarification that i honestly shouldve added originally is im making a small calculator for certain school related stuf. the main number/integer is used in a confirmation formula(3) and the decimals(.0847) in the next part of the calculation. (also learning some of the math related english while doing this lol)
what would be the worries in doing it as is? getting the main/integer with floor and the decimal part with quontient of?
the number doesnt need to be rounded up ever for floor and the calculations shoulnt ever run into negatives as long as its used correctly so im not worried about that.
from (the little) testing the current solution doesnt seem to have issues.
also sry for doing this in kinda sporadic way. its the first time iw looked into this without being dead tired.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.