Delphi FormatFloat Style Mesa

Source code
Unit1.pas
-----

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Edit3: TEdit;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Edit4: TEdit;
    Edit5: TEdit;
    Label7: TLabel;
    Label8: TLabel;
    Edit6: TEdit;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  x,
  y,
  z: Extended;
begin
  x:= 190.5;
  y:= 0;
  z:= 150000.68;
  edit1.Text:= format('%f',[x]);
  edit2.Text:= format('%f',[y]);
  edit3.Text:= format('%f',[z]);

  edit4.Text:= format('%f',[x]);
  edit5.Text:= format('%f',[y]);
  edit6.Text:= format('%f',[z]);


  Label1.Caption := formatfloat(',0.00',x);
  Label2.Caption := formatfloat(',0.00',y);
  Label3.Caption := formatfloat(',0.00',z);

  Label7.Caption := formatfloat('#,###0.00',x);
  Label8.Caption := formatfloat('#,###0.00',y);
  Label9.Caption := formatfloat('#,###0.00',z);
end;

end.

Unit1.dfm
-----
object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'FormatFloat Stye MESA'
  ClientHeight = 427
  ClientWidth = 527
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 422
    Top = 80
    Width = 37
    Height = 16
    Alignment = taRightJustify
    Caption = 'Label1'
    Color = clBtnFace
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGreen
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentColor = False
    ParentFont = False
  end
  object Label2: TLabel
    Left = 422
    Top = 110
    Width = 37
    Height = 16
    Alignment = taRightJustify
    Caption = 'Label1'
    Color = clBtnFace
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGreen
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentColor = False
    ParentFont = False
  end
  object Label3: TLabel
    Left = 422
    Top = 137
    Width = 37
    Height = 16
    Alignment = taRightJustify
    Caption = 'Label1'
    Color = clBtnFace
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGreen
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentColor = False
    ParentFont = False
  end
  object Label4: TLabel
    Left = 159
    Top = 80
    Width = 193
    Height = 16
    Caption = 'formatfloat('#39',0.00'#39') ========>'
    Color = clBtnFace
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGreen
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentColor = False
    ParentFont = False
  end
  object Label5: TLabel
    Left = 159
    Top = 110
    Width = 193
    Height = 16
    Caption = 'formatfloat('#39',0.00'#39') ========>'
    Color = clBtnFace
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGreen
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentColor = False
    ParentFont = False
  end
  object Label6: TLabel
    Left = 159
    Top = 137
    Width = 193
    Height = 16
    Caption = 'formatfloat('#39',0.00'#39') ========>'
    Color = clBtnFace
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGreen
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentColor = False
    ParentFont = False
  end
  object Label7: TLabel
    Left = 422
    Top = 200
    Width = 37
    Height = 16
    Alignment = taRightJustify
    Caption = 'Label1'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label8: TLabel
    Left = 422
    Top = 230
    Width = 37
    Height = 16
    Alignment = taRightJustify
    Caption = 'Label1'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label9: TLabel
    Left = 422
    Top = 257
    Width = 37
    Height = 16
    Alignment = taRightJustify
    Caption = 'Label1'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label10: TLabel
    Left = 159
    Top = 200
    Width = 229
    Height = 16
    Caption = 'formatfloat('#39'#,###0.00'#39') ========>'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label11: TLabel
    Left = 159
    Top = 230
    Width = 229
    Height = 16
    Caption = 'formatfloat('#39'#,###0.00'#39') ========>'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label12: TLabel
    Left = 159
    Top = 257
    Width = 229
    Height = 16
    Caption = 'formatfloat('#39'#,###0.00'#39') ========>'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label13: TLabel
    Left = 32
    Top = 48
    Width = 441
    Height = 16
    Caption =
      #3611#3585#3605#3636#3592#3632#3648#3621#3639#3629#3585#3648#3586#3637#3618#3609#3649#3610#3610' formatfloat(,0.00) '#3610#3656#3629#3618#3607#3637#3656#3626#3640#3604' '#3627#3619#3639#3629#3648#3611#3655#3609' defau' +
      'lt stype '#3586#3629#3591#3612#3617
    Color = clBtnFace
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGreen
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentColor = False
    ParentFont = False
  end
  object Label14: TLabel
    Left = 32
    Top = 178
    Width = 205
    Height = 16
    Caption = #3652#3617#3656#3648#3588#3618#3648#3586#3637#3618#3609#3649#3610#3610#3609#3637#3657' '#3627#3619#3639#3629#3652#3617#3656#3652#3604#3657#3651#3594#3657#3610#3656#3629#3618#3609#3633#3585
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clMaroon
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label15: TLabel
    Left = 32
    Top = 406
    Width = 144
    Height = 13
    Caption = 'View source below screenshot'
  end
  object Edit1: TEdit
    Left = 32
    Top = 80
    Width = 121
    Height = 21
    TabOrder = 0
    Text = 'Edit1'
  end
  object Edit2: TEdit
    Left = 32
    Top = 107
    Width = 121
    Height = 21
    TabOrder = 1
    Text = 'Edit1'
  end
  object Edit3: TEdit
    Left = 32
    Top = 134
    Width = 121
    Height = 21
    TabOrder = 2
    Text = 'Edit1'
  end
  object Edit4: TEdit
    Left = 32
    Top = 200
    Width = 121
    Height = 21
    TabOrder = 3
    Text = 'Edit1'
  end
  object Edit5: TEdit
    Left = 32
    Top = 227
    Width = 121
    Height = 21
    TabOrder = 4
    Text = 'Edit1'
  end
  object Edit6: TEdit
    Left = 32
    Top = 254
    Width = 121
    Height = 21
    TabOrder = 5
    Text = 'Edit1'
  end
end

Comments