SYS_Unit.milToInch() method
Unit conversion: mils to inches
Signature
typescript
function milToInch(mil: number, numberOfDecimals?: number): number;1
Parameters
Parameter | Type | Description |
|---|---|---|
mil | number | Input value in mils |
numberOfDecimals | number | (Optional) Number of decimal places to keep, default is |
Returns
number
Output value in inches
Example
javascript
// 1. 基本换算:1000 mil = 1 英寸(同步返回数值,无需 await)
console.log('1000 mil =', eda.sys_Unit.milToInch(1000), '英寸');
// 2. 常用线宽换算:6 mil 与 10 mil
console.log('6 mil =', eda.sys_Unit.milToInch(6), '英寸');
console.log('10 mil =', eda.sys_Unit.milToInch(10), '英寸');
// 3. 指定保留 6 位小数(默认 4 位,小尺寸需要更多位才不损失精度)
console.log('6 mil 保留 6 位小数 =', eda.sys_Unit.milToInch(6, 6), '英寸');1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9