Home
Forum
Rules
Search
Login
Register
October 08, 2024, 12:32:02 am
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Follow Soldat on Social Media
:
Facebook
,
Twitter
,
Reddit
Official Soldat Forums
Server Talk
Scripting Discussions and Help
(Moderators:
chrisgbk
,
Bonecrusher
)
Removing zeros
« previous
next »
Pages: [
1
]
Author
Topic: Removing zeros (Read 1110 times)
0 Members and 1 Guest are viewing this topic.
MrHamsTR
Soldier
Posts: 209
One day, everything will end..
Removing zeros
«
on:
July 18, 2014, 05:13:32 pm »
Script core and server are developing, I cant use and find working scripts. Now I'm using vote with zeros (0.0000000)
One time I fixed but now I forgot how did I do that, I cant fix it, tried 15-20 times.
Code is here;
http://pastebin.com/5bdvdEfp
Logged
Is there anybody can write script?
Good, go and play soldat ^^
Shoozza
Retired Soldat Developer
Veteran
Posts: 1632
Soldat's Babysitter
Re: Removing zeros
«
Reply #1 on:
July 19, 2014, 12:47:35 am »
I guess you want to format floating point output.
Try
FormatFloat('#.##', yourfloat)
or
Format('%.2f', [yourfloat]);
or
FloatToStrF(yourfloat, ffFixed, 4, 2));
They are explained here:
http://www.delphibasics.co.uk/RTL.asp?Name=FormatFloat
http://www.delphibasics.co.uk/RTL.asp?Name=FloatToStrF
http://www.delphibasics.co.uk/RTL.asp?Name=Format
Don't give up too early. Finding solutions on your own is a skill you have to build
Logged
Rules
Tools:
ARSSE
-
SARS
-
SRB
-
chatMod
Pages: [
1
]
« previous
next »
Official Soldat Forums
Server Talk
Scripting Discussions and Help
(Moderators:
chrisgbk
,
Bonecrusher
)
Removing zeros