Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / HELP NEEDED Trunkating a number i.e 1.2345555 to 1.235 help pls or 1:14:200 eg

Author
Message
Newbie5UK
20
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 3rd Dec 2004 21:42
Can anyone share with me a formula or code to trunkcate what is really a laptime in a racing game from

e.g. 1.2344567 to 1.235 for example

or even better help me with producing a time format like 1:14:200 with minutes, sec, 100th sec...

thx
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Dec 2004 00:59
Not sure if will help but try looking at the timer() command in the help files.

In Space No One can Hear You Scream! (When your comm Line is cut?)
Mr Underhill
21
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 4th Dec 2004 02:10 Edited at: 4th Dec 2004 02:45
{EDIT:}Oooogh...just tested my code and it doesn't work. Sorry about that. I'll work on some new code that does work.

{EDIT 2:} Sorry, I give up. It seems DBP doesn't like me messing with floats, and it's frustrating as heck. I hope someone can figure it out.

Quote: "A kilobyte is 1024 bytes, not 1028.
I mean.... not.. that i.... new that already.... i figured... maybe... CRUD! IM A NERD! -Ion Stream"

I feel your pain, man. Wait...pain?!
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 4th Dec 2004 02:53
Make it into a string and grab the numbers from there.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 4th Dec 2004 06:34
for formatting the tc_FormatNum() function comes to mind...


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 5th Dec 2004 04:54
Just knocked this together. Sure it's been done before, but I was bored.



p.s. tested for correctness for about 20 seconds. No guarantees it will still work after that, though.


Login to post a reply

Server time is: 2024-11-13 18:40:18
Your offset time is: 2024-11-13 18:40:18