---
title: "Missing Decimal Point in G-Code: Why It Crashes"
description: "A missing decimal point can make a G-code move 1000 times too big or too small, depending on the control's setting. Here is why it happens and how to avoid it."
url: https://gcodepractice.com/journal/missing-decimal-point-in-g-code-crash/
canonical: https://gcodepractice.com/journal/missing-decimal-point-in-g-code-crash/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-06-04
updated: 2026-06-04
category: "Guides"
tags: ["g-code", "decimal-point", "crash", "fanuc", "safety basics"]
lang: en
---

# Missing Decimal Point in G-Code: Why It Crashes

> **TL;DR** A number without a decimal point is ambiguous. Many controls can read X10 either as 10 millimeters or as 10 of the smallest increment (0.010 mm), depending on a parameter. If the program assumes one and the machine is set to the other, every plain number is wrong by a factor of 1000, which can overtravel or crash. The fix is to always write explicit decimals.

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](https://linuxcnc.org/docs/html/gcode/g-code.html), and the same idea appears across controls in the [Wikipedia G-code overview](https://en.wikipedia.org/wiki/G-code).

## 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 (`X10` meaning 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](/journal/g20-vs-g21-inch-vs-metric/): 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](/journal/why-did-my-cnc-crash-on-g00/) 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](/journal/do-i-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](/journal/how-to-safely-test-a-g-code-program-without-crashing/), the kind of review a practice routine on the [G-code practice hub](/g-code-practice/) 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](/journal/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)](https://linuxcnc.org/docs/html/gcode/g-code.html)
- [Wikipedia: G-code](https://en.wikipedia.org/wiki/G-code)
- [CNCCookbook: G-code and M-code cheat sheet](https://www.cnccookbook.com/g-code-m-code-cnc-list-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.*

---

Source: https://gcodepractice.com/journal/missing-decimal-point-in-g-code-crash/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
