imperial to metric convertion for CNC GUI

I am trying to do the following

calculated:
1 thou = 1000th of an inch
39th = 1.016mm

I am having problems with converting this file to metric co-ords. I would like to complete the conversion to metric on a SD card a delete the imperial format or, make a new sub directory to save new data.

M48
%
T01
X-005000Y+008500
X-004000Y+008500
X-003000Y+008500
X-002000Y+008500
X-001000Y+008500
X+000000Y+008500
X+001000Y+008500
X+002000Y+008500
X+003000Y+008500
X+004000Y+008500
X+005000Y+008500
X+006000Y+008500
X+007000Y+008500
X+008000Y+008500
X+009000Y+008500
X+010000Y+008500
X+011000Y+008500
X+012000Y+008500
X+013000Y+008500
X+014000Y+008500
X+014000Y+014500
X+013000Y+014500
X+012000Y+014500
X+011000Y+014500
X+010000Y+014500
X+009000Y+014500
X+008000Y+014500
X+007000Y+014500
X+006000Y+014500
X+005000Y+014500
X+004000Y+014500
X+003000Y+014500
X+002000Y+014500
X+001000Y+014500
X+000000Y+014500
X-001000Y+014500
X-002000Y+014500
X-003000Y+014500
X-004000Y+014500
X-005000Y+014500
X+004500Y+005000
X+005500Y+005000
X-004000Y+005500
X-003000Y+005500
X-002000Y+005500
X-001000Y+005500
X+000000Y+005500
X+001000Y+005500
X-005000Y+018000
X-004000Y+018000
X-003000Y+018000
X-002000Y+018000
X-001000Y+018000
X+000000Y+018000
X+001000Y+018000
X+002000Y+018000
X+009000Y+006000
X+010000Y+006000
X+011000Y+006000
X+012000Y+006000
X+009000Y+018000
X+010000Y+018000
X+011000Y+018000
X+012000Y+018000
X+013500Y+006000
X+014500Y+006000
X+013500Y+018000
X+014500Y+018000
X+004500Y+018000
X+005500Y+018000
X+006500Y+018000
X+007500Y+018000
T02
X+007000Y-000500
X+008000Y-000500
X+003000Y-000500
X+004000Y-000500
X+004500Y-003500
X+006500Y-003500
M30

I am having problems with converting this file to metric co-ords

And those problems are what, exactly?

were origin X Y becomes negative value.

Gates:
were origin X Y becomes negative value.

Signs are different in metric and imperial?

Returns mil in mm with 4 digits fixed decimal point
long milToMm(int mil){
  return 254L * mil;
}

One inch is defined as 25.4 millimetres.

...R

Robin2:
One inch is defined as 25.4 millimetres.

...R

Which is a helluva lot more precise than "three grains of barley, dry and round, placed end to end, lengthwise".

AWOL:
Which is a helluva lot more precise than "three grains of barley, dry and round, placed end to end, lengthwise".

I was just thinking that it is easy to use in calculations :slight_smile:

...R