Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 21st, 2012  |  syntax: Delphi  |  size: 2.70 KB  |  hits: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. begin
  2.   if Combobox3.ItemIndex = 0  then
  3.   case Combobox1.Itemindex of
  4.       0: case Combobox2.Itemindex of
  5.          0: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1);
  6.          1: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1000);
  7.          2: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1000000);
  8.          3: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1000000000);
  9.       end;
  10.       1: case Combobox2.Itemindex of
  11.          0: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 1000);
  12.          1: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1);
  13.          2: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1000);
  14.          3: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1000000);
  15.       end;
  16.       2: case Combobox2.Itemindex of
  17.          0: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 1000000);
  18.          1: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 1000);
  19.          2: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1);
  20.          3: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1000);
  21.       end;
  22.       3: case Combobox2.Itemindex of
  23.          0: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 1000000000);
  24.          1: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 1000000);
  25.          2: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 1000);
  26.          3: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 1);
  27.       end;
  28.  
  29.     else
  30.  
  31.     if Combobox3.ItemIndex = 1 then
  32.     case Combobox1.ItemIndex of
  33.       0: case Combobox2.Itemindex of
  34.          0: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1);
  35.          1: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 100);
  36.          2: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 10000);
  37.          3: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1000000);
  38.       end;
  39.       1: case Combobox2.Itemindex of
  40.          0: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 100);
  41.          1: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1);
  42.          2: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 100);
  43.          3: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 10000);
  44.       end;
  45.       2: case Combobox2.Itemindex of
  46.          0: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 10000);
  47.          1: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 100);
  48.          2: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 1);
  49.          3: Edit2.Text:= floattostr(strtofloat(Edit1.Text) / 100);
  50.       end;
  51.       3: case Combobox2.Itemindex of
  52.          0: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 1000000);
  53.          1: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 10000);
  54.          2: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 100);
  55.          3: Edit2.Text:= floattostr(strtofloat(Edit1.Text) * 1);
  56.  
  57.     end;