Format Function

Hi,

I would like to output an Age (e.g. 151 years) via Format:

Dim Age As Integer = 151 MsgBox Format(Age, "000") // will Return 105
Why i’ll get the wrong Output? Works Fine with Agenumber e.g. 121

Not here it doesn’t but there’s not much context to know

  • what OS ?
  • what version of Xojo ?
  • what kind of project ?

Hello,

I am using Xojo 2015 r2.3 on Windows 7.

When I try your code :

Dim intAge As Integer = 151 MsgBox Format(intAge, "000")

it gives 151 as a result, which is correct. I do not know what is wrong at your place.

[quote=237419:@Norman Palardy]Not here it doesn’t but there’s not much context to know

  • what OS ?
  • what version of Xojo ?
  • what kind of project ?[/quote]
    OS: Mac OS X “El Capitan”
    Version: Xojo 2015.4

Age is Int8 ! That’s the “Error” :smiley:

Please close!

A thank you for the time spent on somebody else problem is always nice, not? Takes not too long and is must better than just “Please close” which in my opinion is rude.

Remember, politeness is also important on the internet!

Sorry Chris, doesn’t want to hurt you. Thank you and merry Christmas :slight_smile: