Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Call of Duty Hacks & Cheats › Call of Duty 6 - Modern Warfare 2 (MW2) Hacks › Call of Duty Modern Warfare 2 Server / GSC Modding › Call of Duty Modern Warfare 2 GSC Modding Help/Discussion › Round up float value

Round up float value

Posts 1–4 of 4 · Page 1 of 1
edub18
edub18
Round up float value
Hey,
is there a way to round up a float value? The internal function doesnt work for some reason. I want to round up a KD-ratio
#1 · 15y ago
Locke
Locke
I don't have much knowledge about exactly this, but I'm pretty sure that if a function is supposed to work and it doesn't, you have done something wrong. It's editing in notepad we're talking about here, and the "rules" apply, no matter what operating system you use, or whether you have steam or aiw version.
#2 · 15y ago
edub18
edub18
Okay i got it working. The next problem is, that it return an integer, but i want a float value (from 1.5777778 to 1.57)
#3 · 15y ago
master131
[MPGH]master131
Code:
roundFloat(floatValue, places)
{
	expValue = exponent(10, places);
	floatValue *= expValue;
	floatValue = int(floatValue);
	floatValue /= expValue;
	return float(floatValue);
}

exponent(basev, exp)
{
	result = 1;
	for(i = 0; i < exp; i++)
		result *= basev;
	return result;
}
Usage:
roundFloat(1.225, 2); //Would return 1.23

Spent ages using a string approach when it's so easy to do it mathematically. I'm so stupid :3
#4 · edited 15y ago · 15y ago
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Tags for this Thread

None