Up \Display
{@abstract(Display utilities)
author: Nikolai V. Shokhirev )
created: May 05, 2002)
last modified: June 15, 2004)
ŠNikolai V. Shokhirev, 2002-2004 }
unit uDisplay;
interface
uses
Math, uMatTypes, Sysutils, grids, controls;
function CopyFromTo(const s: string; i1, i2: integer): string;
function RealToStr(x: TFloat; Width, Decimals: TInt): string;
function StrToFloatDef(const S: string; Default: TFloat = 0.0): TFloat;
function IntgToStr(x, Width: TInt): string;
function IntgToStrPrefix(x: TInt; Prefix: string; Truncate: boolean = false): string;
{ output format: 1.1 + i * 2.2 }
function CplxToStr(x, y: TFloat; Width, Decimals: TInt): string;
{ input formats: 1, i, j, I, J, +1.1-i*2.2, 1.1+i*2.2, i-1, i 1 - 2 }
procedure StrToCplx(const s: string; var x, y: TFloat);
{ minimal decimals:
Minimal necessary number of decimals for labeling the interval [Xmin,Xmax] }
function MinDec(Xmin, Xmax: TFloat): TInt;
{ Compact output of real numbers in scientific notation
decimals = 0 example: 7e+12
decimals = 1 example: 1.3e+0
decimals = 2 example: 1.23e-1 }
function CompactFloatToStr(z: TFloat; decimals: TInt): string;
// function BoolToStr(Value: boolean): string;
// function StrToBool(Value: string): boolean;
procedure FixStringGrid(const SG: TStringGrid; dh: TInt = 16; dw: TInt = 8);
procedure FixStringGrid2(const SG: TStringGrid);
procedure CenterControl(Control: TControl);
implementation
end.
Up \Display