📄 fdutils.pas
字号:
unit FDUtils;
interface
uses
SysUtils;
function InchesToMillimeters(Inches : Double) : Double;
function MillimetersToInches(Millimeters : Double) : Double;
{$IFNDEF Win32}
function Trim(S : string) : string;
{$ENDIF}
implementation
const
InchesPerMeter = 39.37;
function InchesToMillimeters(Inches : Double) : Double;
begin
Result := Inches / InchesPerMeter * 1000.0;
end;
function MillimetersToInches(Millimeters : Double) : Double;
begin
Result := Millimeters * InchesPerMeter / 1000.0;
end;
{$IFNDEF Win32}
function Trim(S : string) : string;
var
I : Byte;
begin
//删除全部的空格
while (Length(S) >= 1) and (S[1] = ' ') do
Delete(S, 1, 1);
//删除全部尾部空格
for I := Length(S) downto 1 do
if S[I] = ' ' then
Delete(S, I, 1)
else
Break;
Result := S;
end;
{$ENDIF}
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -