Ask Your Question
0

In Delphi, what is the method to obtain a numeric variant property?

asked 2021-07-16 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-01 08:00:00 +0000

woof gravatar image

To obtain a numeric variant property in Delphi, use the "AsExtended" method. This method converts the variant property to an extended data type, which is a numeric data type that can handle very large or very small floating point numbers. For example:

var myVariant: Variant; myNumber: Extended; begin myVariant := 123.45; myNumber := myVariant.AsExtended; ShowMessage(FloatToStr(myNumber)); // Displays "123.45" end;

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-07-16 11:00:00 +0000

Seen: 11 times

Last updated: Nov 01 '21