Board index » delphi » Stupid Question from a novice .

Stupid Question from a novice .

I'm new to all this and I'm having a number of problems.
 The most annoying one is how to display real numbers in Delphi.
 Can You redfine the text property to accept real numbers ?
 or is the something teribly obvious i'm missing

feel free to reply or slag me of for wasting peoples time but i would really
like to Know its driving me mad

Ben Warren
Msc16.msc16-L...@BBSRC.ac.uk

Thank YOU !!

 

Re:Stupid Question from a novice .


Quote
Ben.W (msc16.msc16-l...@bbsrc.ac.uk) wrote:

:  The most annoying one is how to display real numbers in Delphi.
For routines that convert from reals to strings search the help file for
"Floating-Point Conversions Routines" (or somesuch).
:  Can You redfine the text property to accept real numbers ? :  or is the
To actually display the string result from one of these functions just
assign it to the Text property of a TEdit, or to the Caption of a TLabel.
: feel free to reply or slag me of for wasting peoples time but i would really
: like to Know its driving me mad
I hoep this is what you wanted and, given your state of mind, that I've
got to you in time! :-)
Cheers, Bill
--

Re:Stupid Question from a novice .


Hello,

Quote
"Ben.W" <msc16.msc16-l...@bbsrc.ac.uk> wrote:
> The most annoying one is how to display real numbers in Delphi.
> Can You redfine the text property to accept real numbers ?
> or is the something teribly obvious i'm missing

Try using the TMaskEdit component... Although it's not perfect, it's a
start ! :=)

Quote
>Thank YOU !!

You're welcome !

Chris.

---------------------------------------------------------
Christian Huwaert, Paradox & Delphi developer(tries to...)
huwa...@chex.ucl.ac.be, Brussels, Belgium

Re:Stupid Question from a novice .


Quote
Ben.W (msc16.msc16-l...@bbsrc.ac.uk) wrote:

:
: I'm new to all this and I'm having a number of problems.
:  The most annoying one is how to display real numbers in Delphi.
:  Can You redfine the text property to accept real numbers ?
:  or is the something teribly obvious i'm missing
:
: feel free to reply or slag me of for wasting peoples time but i would really
: like to Know its driving me mad

No wasting of time at all :)

Well, the ideal solution would be, of course, to make your own
Component based on TEdit which did the conversions for you, but
failing that...

There are a good deal of conversion functions around for text to
numeric and back.  You have:

IntToStr, StrToInt, FloatToStr, FloatToStrF (you can give formatting
for the floating point in FloatToStrF) and StrToFloat.

Data-aware controls to databases have AsInteger, AsString, etc.
properties to them if you're dealing with databases.

Any more questions on that?

--

  --=- Ritchie Annand
    -* New Product Development *-
  _    Malibu Enigneering Ltd.
 / \                                   \
| Me.Views not in (Company.Views)=TRUE  |
 \                                   \_/

Other Threads