#21 2013-06-28 07:19

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Add something like :File_SizeGB: meta tag

den4b wrote:
Stefan wrote:

What output does WideFileSize(FilePath) provide?  What means minus -1355529216?

As SafetyCar has suggested it is due to the limit of Integer type. However, WideFileSize function returns Int64 type - which can hold a value up to 9,223,372,036,854,775,807. It is IntToStr function which type casts Int64 to Integer.

To convert Int64 to string you can type cast it to Double and use FormatFloat('0', Int64) or FloatToStr.

Just to sum up for the learning effect:


So I was wrong with

dSize:Double;
dSize := WideFileSize(FilePath);
sSize := FormatFloat(FLOAT_FORMAT, dSize);

That should have been

i64Size:Int64;
i64Size := WideFileSize(FilePath);
sSize := FormatFloat(FLOAT_FORMAT, i64Size);

since WideFileSize() returns Int64

and I can chage (type cast?)  it to Double by using FormatFloat('0', Int64) or FloatToStr.

(I was assuming that "float" commands works with decimal point numbers only (float to str), hence the use of Double at first.)

(Wiki for FormatFloat() and FloatToStr() reads: "Converts supplied floating point value ..."
but should, as far as I understand now, be "Converts supplied floating point or integer value ..." ??? Or smtg like that.)


And IntToStr function will change (type casts) Int64 to Integer. That's why I get this minus signed numbers. Out of range.


.

Last edited by Stefan (2013-06-28 07:26)


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#22 2017-02-18 15:25

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 353

Re: Add something like :File_SizeGB: meta tag

eR@SeR wrote:
den4b wrote:

I've also added to the TODO list:

Add File_SizeGB and File_SizeAuto meta tags.

When adding those tags you can add Size GB and SizeAuto into columns of files table smile

I hope that these features will be added soon smile


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#23 2017-02-21 23:03

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: Add something like :File_SizeGB: meta tag

eR@SeR wrote:

I hope that these features will be added soon smile

In the next version wink

Offline

#24 2017-02-22 19:10

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 353

Re: Add something like :File_SizeGB: meta tag

Thanks smile


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

Board footer

Powered by FluxBB