Raised This Month: $81 Target: $400

A calculation problem with floats numbers

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Junior Member
Join Date: Apr 2010
Old 11-16-2023 , 06:43   A calculation problem with floats numbers
Reply With Quote #1


I have a problem with doing calculations like 0.01 + 0.03.
Is there toFixed for this thing like in JavaScript?

new Float:floatVal = 0.01 + 0.03;
PrintToChat(client, "$%.2f", floatVal); // $0.03 wrong!!
Alon2k2 is offline

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -4. The time now is 21:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode