ThRuST Well-Known Member Licensed User Longtime User Jun 28, 2018 #1 I have this code. Can you help me implement NumberFormat to remove the decimals? Play around with this Code: Private FileSize As Int FileSize = File.Size ("c:\","Filename") fx.Msgbox(MainForm, FileSize / 1024, "")
I have this code. Can you help me implement NumberFormat to remove the decimals? Play around with this Code: Private FileSize As Int FileSize = File.Size ("c:\","Filename") fx.Msgbox(MainForm, FileSize / 1024, "")
DonManfred Expert Licensed User Longtime User Jun 28, 2018 #2 Is it that hard to figure it out by yourself? What did you tried so far? Upvote 0
ThRuST Well-Known Member Licensed User Longtime User Jun 28, 2018 #3 All ways that did not work? Upvote 0
ThRuST Well-Known Member Licensed User Longtime User Jun 28, 2018 #4 This makes sense, but not correct. Was it close? Code: Private FileSize As Int FileSize = File.Size ("c:\","test.exe") fx.Msgbox(MainForm, FileSize(NumberFormat(1,3,0) / 1024, "")) Upvote 0
This makes sense, but not correct. Was it close? Code: Private FileSize As Int FileSize = File.Size ("c:\","test.exe") fx.Msgbox(MainForm, FileSize(NumberFormat(1,3,0) / 1024, ""))
ThRuST Well-Known Member Licensed User Longtime User Jun 28, 2018 #5 You might win a box of twix if you provide a working solution to this, you never know haha Upvote 0
ThRuST Well-Known Member Licensed User Longtime User Jun 28, 2018 #6 I also tried this Code: fx.Msgbox(MainForm, FileSize / 1024 (NumberFormat(1,3,0)), "") Upvote 0
ThRuST Well-Known Member Licensed User Longtime User Jun 28, 2018 #7 And this Code: fx.Msgbox(MainForm, NumberFormat(FileSize,3,0) / 1024, "") Upvote 0
ThRuST Well-Known Member Licensed User Longtime User Jun 28, 2018 #8 Hang on, I'll keep posting until I solve it myself. Upvote 0
DonManfred Expert Licensed User Longtime User Jun 28, 2018 #9 Code: Private FileSize As Int FileSize = File.Size ("e:\","sqlNO.txt") fx.Msgbox(MainForm, NumberFormat2(FileSize / 1024,7,0,0,False), "") Upvote 0
Code: Private FileSize As Int FileSize = File.Size ("e:\","sqlNO.txt") fx.Msgbox(MainForm, NumberFormat2(FileSize / 1024,7,0,0,False), "")
ThRuST Well-Known Member Licensed User Longtime User Jun 28, 2018 #10 @DonManfred Great. This is the closest I got but it still returns 3 decimals because it uses Double. Even tried Ceil and Round but that's not the way to go Code: Private FileSize As Double FileSize = File.Size ("c:\","test.exe") fx.Msgbox(MainForm, NumberFormat(FileSize,3,0 / 1024), "") Upvote 0
@DonManfred Great. This is the closest I got but it still returns 3 decimals because it uses Double. Even tried Ceil and Round but that's not the way to go Code: Private FileSize As Double FileSize = File.Size ("c:\","test.exe") fx.Msgbox(MainForm, NumberFormat(FileSize,3,0 / 1024), "")
ThRuST Well-Known Member Licensed User Longtime User Jun 28, 2018 #11 Actually this question was a follow up to Resumable subs. So that the value of Sleep can be adjusted according to the size of a file. Madness or Genious, the beauty is in the eyes of the beholder. Your solution was once again better than my own Upvote 0
Actually this question was a follow up to Resumable subs. So that the value of Sleep can be adjusted according to the size of a file. Madness or Genious, the beauty is in the eyes of the beholder. Your solution was once again better than my own