Hello
Guest
it is
March 13, 2025, 05:26:50 PM
Guest
Login
Register
Menu
Home
Help
Search
Login
Register
YouTube
Machsupport Forum
/
Mach Discussion
/
Brains Development
/
Rounding number in brains formula
« previous
next »
Print
Pages:
1
Go Down
Author
Topic: Rounding number in brains formula (Read 21418 times)
0 Members and 2 Guests are viewing this topic.
rrc1962
673
Rounding number in brains formula
«
on:
December 20, 2010, 05:57:14 PM »
Can you round a number in a formula. I need to round the output of a formula to zer decimal places. IE 4.8973 needs to equal 5. The VB script function Round() doesn't work.
Thanks
Logged
poppabear
2,235
Briceville, TN, USA
Re: Rounding number in brains formula
«
Reply #1 on:
December 22, 2010, 10:24:43 AM »
you would need to do a work around.
send the dec val to a UDRO, then in macropump, read in that udro, do a vb round on it, repost it to another udro
in brains read in that rounded udro val and do what ever.
scott
Logged
fun times
Program
3
Re: Rounding number in brains formula
«
Reply #2 on:
March 12, 2016, 04:06:10 PM »
Just in case someone else in the future is looking for another solution to this.
I managed to round a value in brains using a formula someone had posted at stackoverflow.
http://stackoverflow.com/a/17666483
The attached image is of an example rounding the spindle frequency in Hz.
I entered s500 in MDI in mach3, the formula I have then takes the spindle speed and divides by my motors RPM at 60Hz (1765), I then multiply by 60 to get the Hz number.
Logged
Print
Pages:
1
Go Up
« previous
next »