Author Topic: function CutTock(NonInteger:single; Cut:integer):double;  (Read 165 times)

0 Members and 1 Guest are viewing this topic.

Offline soldat-game

  • Camper
  • ***
  • Posts: 349
  • GG: 10210041
function CutTock(NonInteger:single; Cut:integer):double;
« on: July 02, 2018, 04:12:08 pm »
Script Name: CutTock
Script Description: It does not round. It lets you cut off the number in uninteger without rounding. Example use CutTock(84.845567892773,2) return 84.84
100 000 x CutTock(84.845567892773); = 84.840000000000  00:00:01,156 (new fast CutTock function)
100 000 x RealDMG(84.845567892773); = 84.840000000000  00:00:03,355 (from me zitrofun)
100 000 x CutZero(84.845567892773); = 84.840000000000  00:00:03,647 (me other function)
Author: dominikkk26
Compile Test: Passed
Core Version: 2.8.1+

Code: [Select]
function CutTock(NonInteger:single; Cut:integer):double;
var real:integer; real2:double;
begin
real := round(int(NonInteger));
Real2 := (NonInteger-real);
Result := strtofloat(inttostr(real)+'.'+Copy(floattostr(Real2),3,Cut));
end;
Hey, I wrote messages on these topics (https://forums.soldat.pl/index.php?topic=45088.0
https://forums.soldat.pl/index.php?topic=45068.0), about deleting this message in this topic.
https://forums.soldat.pl/index.php?topic=45088.0

"So nothing was done hahahahahaha" Rekt admins remove this all time why? It does not break the rules.