#1

why does this code goes from 1:10 to 1:9 on the clock ?

i need it 1:09 .. 1:08 ( double digits)

pawn Код:
format(strr,sizeof(strr),"%d:%2d",minutes,seconds);
        TextDrawSetString(time, strr);
Reply
#2

pawn Код:
if(minutes < 10) {
    format(strr,sizeof(strr),"%d:0%d",minutes,seconds);
} else {
    format(strr,sizeof(strr),"%d:%2d",minutes,seconds);
}
Reply
#3

Quote:
Originally Posted by Seven_of_Nine
Посмотреть сообщение
pawn Код:
if(minutes < 10) {
    format(strr,sizeof(strr),"%d:0%d",minutes,seconds);
} else {
    format(strr,sizeof(strr),"%d:%2d",minutes,seconds);
}
that might work.. also u mean (seconds < 10) not minutes ?

is that the only way? why doesnt %2d work tho ? its suppose to force it into two digits.. :/
Reply
#4

Quote:
Originally Posted by jamesbond007
Посмотреть сообщение
that might work.. also u mean (seconds < 10) not minutes ?

is that the only way? why doesnt %2d work tho ? its suppose to force it into two digits.. :/
Well I don't wanna go into that.
And yeah *seconds.

Isn't it irrevelant if it actually works? xD
Reply
#5

Quote:
Originally Posted by Seven_of_Nine
Посмотреть сообщение
Well I don't wanna go into that.
And yeah *seconds.

Isn't it irrevelant if it actually works? xD
no its not irrevelant because it should work ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)