|
字符串函数大全(39) Memo1.Lines.Values['ffNumber'] := CurrToStrF(StrToCurrDef(Edit1.Text, 0), ffNumber, SpinEdit1.Value); Memo1.Lines.Values['ffCurrency'] := CurrToStrF(StrToCurrDef(Edit1.Text, 0), ffCurrency, SpinEdit1.Value); end; ///////End CurrToStrF ━━━━━━━━━━━━━━━━━━━━━ 首部 function FloatToText(BufferArg: PChar; const Value; ValueType: TFloatValue; Format: TFloatFormat; Precision, Digits: Integer): Integer; $[SysUtils.pas 功能 返回浮点数以指定格式转换成指针字符串的内存大小 说明 Precision指定精度;Digits指定小数宽度 参考 <NULL> 例子 ///////Begin FloatToText procedure TForm1.Button1Click(Sender: TObject); var VBuffer: array[0..255] of Char; E: Extended; begin E := StrToFloatDef(Edit1.Text, 0); SpinEdit3.Value := FloatToText(VBuffer, E, fvExtended, ffNumber, SpinEdit1.Value, SpinEdit2.Value); Edit2.Text := Copy(VBuffer, 1, SpinEdit3.Value); end; ///////End FloatToText( ━━━━━━━━━━━━━━━━━━━━━
|