Author Topic: Remove decimals  (Read 1554 times)

0 Members and 1 Guest are viewing this topic.

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Remove decimals
« on: 17 November, 2004, 18:30:14 »
Hi, all =)

Code: [Select]
Bot = "FunScript" --//The Bot...
Share = frmHub:GetCurrentShareAmount()/(1024 * 1024 * 1024 ) --//Total Share In GB

function Main()
frmHub:GetHubName() --//Returns The HubName
frmHub:GetUsersCount() --//Returns Number of Online Users
frmHub:GetCurrentShareAmount() --//Returns The Total Share Of All Users At The Moment In Bytes
end

function DataArrival(curUser,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "!share" then
SendToAll(Bot, " Current Share Is "..Share.." GB")
end
end
end

I need some help to remove some decimals....
As it is now, answers like this...
[18:17:58]  Current Share Is 0.4688072642311454 GB

but i want it to only write  0.46 GB

Can any do that, or tell me how to do it..
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

PtokaX forum

Remove decimals
« on: 17 November, 2004, 18:30:14 »

Offline Themaster

  • Triple Ace
  • **
  • Posts: 204
  • Karma: +0/-0
(No subject)
« Reply #1 on: 17 November, 2004, 18:36:04 »
what about that

Code: [Select]
Total Share on the hub  "..format("%.2f", frmHub:GetCurrentShareAmount()/GB).." GB Share Now."
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #2 on: 17 November, 2004, 22:15:15 »
Thanks That Helped =)
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline Themaster

  • Triple Ace
  • **
  • Posts: 204
  • Karma: +0/-0
(No subject)
« Reply #3 on: 17 November, 2004, 22:19:45 »
No problem
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

PtokaX forum

(No subject)
« Reply #3 on: 17 November, 2004, 22:19:45 »