Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Expression 2 v
« Previous 1 … 4 5 6 7 8 Next »
HELP: Making a percentage without decimals
Thread Closed 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
HELP: Making a percentage without decimals
12-07-2014, 07:40 PM,
#1
Alanzote Offline
TSCM Member
***
Posts: 123
Threads: 40
Joined: Oct 2013
HELP: Making a percentage without decimals
I am making a shield stats E2 but the percent show its' decimals:
16.66666666%
I'd like to be 16%, what I mean it's remove the decimals!
My Code:
ShieldUpercent = SUP/STC*100
E:egpText(19, ShieldUpercent+"%", vec2(255,255))
###################################

[Image: stargate_kawoosh_animation_HD_by_SergeyDruid.gif] [Image: kecepatan-cahaya-light-speed-warp-drive2....gif?w=640]
Find
12-07-2014, 07:47 PM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: HELP: Making a percentage without decimals
Use floor() on the number, so:
Code:
ShieldUpercent = floor( SUP / STC * 100 )
Find
12-07-2014, 07:59 PM,
#3
Alanzote Offline
TSCM Member
***
Posts: 123
Threads: 40
Joined: Oct 2013
RE: HELP: Making a percentage without decimals
(12-07-2014, 07:47 PM)Person8880 Wrote: Use floor() on the number, so:
Code:
ShieldUpercent = floor( SUP / STC * 100 )
Thanks Person!

[Image: stargate_kawoosh_animation_HD_by_SergeyDruid.gif] [Image: kecepatan-cahaya-light-speed-warp-drive2....gif?w=640]
Find
« Next Oldest | Next Newest »
Thread Closed 


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.