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;
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
Asked: 2021-07-16 11:00:00 +0000
Seen: 11 times
Last updated: Nov 01 '21
Can the new position of a dynamically shifted control be saved in Delphi?
In Delphi, what is the method for formatting a Unix timestamp?
How to display a form or a "please wait" panel while executing a task in FMX Delphi 10.2?
How can I show a checkmark in a Boolean field in Delphi's DBGrid?
How can memory leaks in UnicodeStrings be addressed in Delphi?
How can POST data be handled in the OnNavigate event when using Delphi TEdgeBrowser?