Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 02:09:12 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
Mach Screens
Flash Screens
How to round numbers
Pages:
1
Go Down
« previous
next »
Author
Topic: How to round numbers (Read 2781 times)
0 Members and 1 Guest are viewing this topic.
azambuja
Active Member
Offline
Posts: 10
How to round numbers
«
on:
September 08, 2008, 12:44:07 PM »
Hello friends,
How can I make this transformation:
1.3333 to 1.33
I tried to use this code:
X=Round(GetDRO(0),2)
AB=Round(X*100)/100
Call SetOEMDRO(800,AB)
but the number I got was 1.3300.
All that I wanted was 1.33.
Thanks for any support.
«
Last Edit: September 08, 2008, 12:46:16 PM by azambuja
»
Logged
Chaoticone
South Carolina, US
Administrator
Offline
Posts: 3,598
Precision Chaos
Re: How to round numbers
«
Reply #1 on:
September 08, 2008, 12:57:16 PM »
Can you format your dro/s to only display two decimal places and then when it pulls the value from that DRO will it only use what is seen?
Just thinking out loud.
Brett
Logged
If you could see the things I have in my head, you would be laughing too.
www.precisionchaos1.com
My guard dog is not what you need to worry about!
azambuja
Active Member
Offline
Posts: 10
Re: How to round numbers
«
Reply #2 on:
September 08, 2008, 01:01:29 PM »
How can I format my DRO's?
I do not know how to do it.
If you know how, hepl me.
thanks
Logged
Chaoticone
South Carolina, US
Administrator
Offline
Posts: 3,598
Precision Chaos
Re: How to round numbers
«
Reply #3 on:
September 08, 2008, 01:03:26 PM »
If this is a flash screen your dealing with, I can't help you.
Brett
Logged
If you could see the things I have in my head, you would be laughing too.
www.precisionchaos1.com
My guard dog is not what you need to worry about!
azambuja
Active Member
Offline
Posts: 10
Re: How to round numbers
«
Reply #4 on:
September 08, 2008, 01:05:08 PM »
Yes, it is a flash screen.
And thanks again.
Logged
zealous
Active Member
Offline
Posts: 486
Re: How to round numbers
«
Reply #5 on:
September 08, 2008, 01:54:02 PM »
Hi,
To format a DRO use:
Example will format DRO 104
Code:
fscommand( "DROFmt104", "%.0f")
To format to time based:
Example will format DRO 815 and 814
Code:
fscommand( "DROFmt815", "%D:%H:%M:%S")
fscommand( "DROFmt814", "%D:%H:%M:%S")
Thanks,
Jason Blake
«
Last Edit: September 08, 2008, 02:01:34 PM by zealous
»
Logged
Regards, Jason Blake
www.Fusioncnc.com
zealous
Active Member
Offline
Posts: 486
Re: How to round numbers
«
Reply #6 on:
September 08, 2008, 02:01:07 PM »
These are the formating parameters:
Days:Hours:Minutes:Seconds
Code:
"%D:%H:%M:%S"
(f)loating point number, (4) decimal points, (+) or -
Code:
"+%.4f"
integer, no decimals
Code:
"%i"
hex number
Code:
"%x"
Format to send the above:
fscommand(
TYPE
fmt
DRO Number
,
ABOVE FORMAT
)
Example:
fscommand ("DROFmt800" , "format" )
Logged
Regards, Jason Blake
www.Fusioncnc.com
azambuja
Active Member
Offline
Posts: 10
Re: How to round numbers
«
Reply #7 on:
September 08, 2008, 02:28:03 PM »
This was really helpfull.
Thanks a lot.
azambuja
Logged
zealous
Active Member
Offline
Posts: 486
Re: How to round numbers
«
Reply #8 on:
September 11, 2008, 06:12:16 PM »
Great
Logged
Regards, Jason Blake
www.Fusioncnc.com
Chaoticone
South Carolina, US
Administrator
Offline
Posts: 3,598
Precision Chaos
Re: How to round numbers
«
Reply #9 on:
September 11, 2008, 06:13:35 PM »
Thanks for helping Jason.
Brett
Logged
If you could see the things I have in my head, you would be laughing too.
www.precisionchaos1.com
My guard dog is not what you need to worry about!
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...