This is an educational explanation of a common programming error, not operating advice for your specific machine. Always verify a program and follow your machine’s manual and shop procedures before running it.
A dropped decimal point is one of the most dangerous typos in G-code, and not because the control rejects it. The control often accepts it and quietly reads the number on a different scale than you meant. The result can be a move 1000 times too small or too large.
Why a plain number is ambiguous
The trouble is that many controls support two ways of reading a number that has no decimal point, selected by a parameter:
| You write | Standard interpretation | Calculator-type interpretation |
|---|---|---|
X10 | 10 increments = 0.010 mm | 10 mm |
Z-5 | 5 increments = 0.005 mm | 5 mm |
X10. | 10 mm | 10 mm |
With standard decimal programming, a number without a decimal is counted in the smallest input increment (commonly 0.001 mm), so X10 is just 0.010 mm. With calculator-type input, X10 is a full 10 mm. The number format and least increment are discussed in the LinuxCNC reference, and the same idea appears across controls in the Wikipedia G-code overview.
How that becomes a crash
The danger is a mismatch between how the program was written and how the machine is set:
- A program written assuming whole units (
X10meaning 10 mm) run on a control set to standard mode makes every plain move 1000 times too small. Usually that just scraps a part, but a Z that does not retract far enough can still gouge. - The opposite mismatch is worse: small values meant as increments read as whole units send a move 1000 times too far, which overtravels into the part, fixture, or machine.
This is a close cousin of the units scale error in G20 vs G21: in both cases the geometry is fine but the machine reads the numbers on the wrong scale. And like a wrong offset, it is the kind of thing that turns up as a G00 crash at full rapid speed.
The fix: always write decimals
The reliable fix is a single habit: put an explicit decimal point on every value. Write X10., Z-5., R2., never X10 or Z-5. With a decimal present, the value means exactly what it says regardless of the control’s parameter, so the ambiguity is gone:
| Habit | Result |
|---|---|
X10. (decimal) | Always 10 mm, on any setting |
X10 (no decimal) | 10 mm or 0.010 mm, depending on the machine |
Most shops make explicit decimals a hard rule, and many CAM post-processors enforce it automatically. It is worth knowing what does not matter here: leading zeros are harmless, so the question of whether you have to type leading zeros in G00 is a non-issue, while the decimal point is the part to get right. Catching a missing decimal is also part of safely testing a program before you cut, the kind of review a practice routine on the G-code practice hub trains.
A different but related alarm
Do not confuse a missing decimal with a misplaced one. Putting a decimal where the control does not allow it triggers a separate fault, covered in Fanuc illegal use of decimal point alarm. A missing decimal usually runs silently and wrong; an illegal decimal stops the program with an alarm.
Bottom line
A missing decimal point makes a number ambiguous, so the control may read it 1000 times too small or too large depending on a parameter, which can scrap a part or cause a crash. Always write explicit decimal points on every value, and verify the program before you run it.
Sources
- LinuxCNC G-code reference (number format)
- Wikipedia: G-code
- CNCCookbook: G-code and M-code cheat sheet
Frequently asked questions
What happens if you forget a decimal point in G-code?
The number becomes ambiguous. Depending on the control’s setting, X10 can mean 10 mm or 0.010 mm, so a dropped decimal can make a move 1000 times too small or, on a control set the other way, far too large.
Does a missing decimal point cause a crash?
It can. If plain numbers are read as tiny increments, moves come up far too short and scrap parts. If they are read as whole units when small values were intended, a move can be 1000 times too far and overtravel into the part or machine.
How do you avoid the decimal-point problem?
Always write explicit decimal points: X10. not X10, Z-5. not Z-5. With a decimal present the value means the same thing on any control, so the ambiguity disappears.
What is the best way to learn safe G-code habits?
Practice with active recall until habits like explicit decimals are automatic. A free app like G-Code Sprint drills the codes and number formats and repeats whichever ones you miss.
G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.