A just out of curiosity question re @DiskTotal

May 24, 2010
855
0
Northlake, Il
As always, an example:
Code:
[Z:\]Echo %@Comma[%@Eval[%@DiskTotal[C:,k]+%@DiskTotal[D:,k]+%@DiskTotal[E:,k]]]
491,514,744

[Z:\]Echo %@Comma[%@Eval[%@DiskTotal[C:,m]+%@DiskTotal[D:,m]+%@DiskTotal[E:,m]]]
491,513
The question is, of course, how there can be fewer megabytes than kilobytes, particularly when the the number of kilobytes has the value that it has ...m744]? What am I missing here?
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
Most likely it's due to truncation error. Display the individual disk totals, then the sum and see if it's different.
Code:
Echo %@DiskTotal[C:,kc] %@DiskTotal[D:,kc] %@DiskTotal[E:,kc]  %@Comma[%@Eval[%@DiskTotal[C:,k]+%@DiskTotal[D:,k]+%@DiskTotal[E:,k]]]
Echo %@DiskTotal[C:,mc] %@DiskTotal[D:,mc] %@DiskTotal[E:,mc]  %@Comma[%@Eval[%@DiskTotal[C:,m]+%@DiskTotal[D:,m]+%@DiskTotal[E:,m]]]
 
May 24, 2010
855
0
Northlake, Il
Guys, I found the problem. You see, the function truncates any fractional value so the 321987k becomes 321m and it is the sum of those three what would be fractional megabyte values that goes up to the next megabyte in the kilobyte measurements and those fractional values for megabytes are discarded.
 
Similar threads
Thread starter Title Forum Replies Date
M A just-out-of-curiosity question because it's ... Support 6
M Just an out-of-curiosity question re. "Do ... /P ..." Support 31
M Just an out-of-curiosity question the List command vs. the @Lines function... Support 13
M A question about file compression that is just out of curiosity... Support 2
M A purely out-of-curiosity question about @DriveType and @DriveTypeEx Support 2
M Question about the "Start" command that is admittedly not too important and just out of curiosity... Support 1
M Kind of a out-of-curiosity question re. the "Function" command... Support 5
M Just a curiosity question related to the "Function" command... Support 2
R Curiosity - can TCC be a VBA Add-In? Support 2
vefatica A help curiosity Support 1
J assoc curiosity Support 1
C forum Posting Question... Support 3
C question re: Move Support 3
S How to? Upgrade Question: What supporting documentation is required at time of purchase? Support 2
Peter Murschall Documentation Question to %@PSHELL Support 4
Fross Tab Question Support 6
Fross Quick Function Question Support 17
Dick Johnson Question about the Touch command Support 0
rps Documentation "Copy+Paste+run" question Support 2
vefatica SFTP question Support 17
vefatica Question about IPWorks Support 0
C How to? SHORTCUT question..... Support 6
vefatica TPIPE, crash and question Support 1
C Question / Suggestion Support 1
MickeyF Another TPIPE question Support 6
vefatica Another @EVERYTHING question Support 4
mikea How to? %@everything[] question Support 10
A License Question for Single User Support 5
Jay Sage Help Correction (and Related Question) Support 0
S Elapsed time in TCC prompt question Support 0
H command line parsing question Support 5
C Forum question Support 2
B Newbie here, I have a question. Support 4
J Dumb Question ... Support 4
Timothy Byrd Updating from TC 9 to TC 17 - TCTOOLBAR question Support 2
M A possibly stupid question about the "del" command... Support 7
Fross Status Bar Time Question Support 1
A Stupid, obvious question - launch a BAT with TC Support 10
C How to? GLOBAL question Support 5
vefatica OT: VisualStudio question Support 1
vefatica Wildcard question Support 4
Dan Glynhampton v15 installer question Support 2
C Move question with Encrypted file... Support 6
M Maybe Maybe I'm being stupid (again), but a simple question... Support 4
C Message Board question Support 1
James Miller How to? filename completion question Support 1
C coding question Support 3
Frank question to FOLDERMONITOR Support 14
C Dumb titleprompt question Support 4
M Upgrade Question Support 2

Similar threads