@zxandris
I don't know how it is possible to google that kind of wrong result, but see what happens with some example args:
WriteLn(strFormatSize(1024+1)); // output: 1.1 kb
WriteLn(strFormatSize(1024+102)); // output: 1.10 kb
WriteLn(strFormatSize(1024+1023)); // output: 1.10 kb
WriteLn(strFormatSize(1024+9)); // output: 1.9 kb
WriteLn(strFormatSize(1024+90)); // output: 1.90 kb
WriteLn(strFormatSize(1024+900)); // output: 1.90 kb
Recently, I have noticed one of the forum members used in its own signature the quote:
“Good judgement is the result of experience and experience the result of bad judgement.”
― Mark Twain
So, it is quite important to understand your own mistakes in order to make good judgements later. Otherwise you'll continue to use some half-witted (googled or AI generated) code in your programs.
The
Kays post has some useful info about the topic.