To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 6374
6373  |  6375
Subject: 
Delphi and decimal signs.
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 20 Aug 2001 18:20:34 GMT
Viewed: 
368 times
  
Look at following Delphi code:
  s: string;
  f: double;
  i: Integer;
begin
  f := 3.14; // correct
  f := 3,14; // error (of course...)
  f := StrToFloat('3.14'); // error
  f := StrToFloat('3,14'); // correct
  s := FloatToStr(3.14); // s is assigned '3,14'

Is it the same with an English/American version of Windows and default national settings?


/Tore



Message has 3 Replies:
  Re: Delphi and decimal signs.
 
(...) national settings? f := 3.14; // correct f := 3,14; // error f := StrToFloat('3.14'); // correct f := StrToFloat('3,14'); // error s := FloatToStr(3.14); // s is assigned '3.14' -Gary (23 years ago, 20-Aug-01, to lugnet.cad.dev)
  Re: Delphi and decimal signs.
 
(...) With careful manipulation of the DecimalSeparator and ThousandSeparator global variables, one could write a Delphi app that reads/writes periods (full stop symbols) from/to DAT files, but displays the locale-specific symbols to the user and (...) (23 years ago, 20-Aug-01, to lugnet.cad.dev)
  Re: Delphi and decimal signs.
 
"Tore Eriksson" <tore.eriksson@mbox3...wipnet.se> skrev i meddelandet news:3B8154F2.D99058...pnet.se... (...) national settings? The problem is that numerical constants in the code must always adhere to the English notation (decimal point). (...) (23 years ago, 20-Aug-01, to lugnet.cad.dev)

7 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR