SigServer:SignatureMath: Difference between revisions

→‎Function Reference: Added div, length, and random
(→‎Function Reference: Un-bolded "Example" for easier reading)
(→‎Function Reference: Added div, length, and random)
Line 107: Line 107:
  ceil(1.4); // Returns 2
  ceil(1.4); // Returns 2
  ceil(1.9); // Returns 2
  ceil(1.9); // Returns 2
==== div ====
''number'' '''div'''(''number'' dividend, ''number'' divisor);
Returns the integer quotient when dividing dividend with divider.
Example:
div(10, 3); // Returns 3


==== floor ====
==== floor ====
Line 146: Line 153:
  pow(3, 2); // Returns 9
  pow(3, 2); // Returns 9
  pow(2, 3); // Returns 8
  pow(2, 3); // Returns 8
==== random ====
''number'' '''random'''(''number'' start, ''number'' end);
Returns a random integer from the set of integers starting at start and ending at end.
Example:
random(1, 10);  // Returns a random integer from 1 to 10
random(0, 100); // Returns a random integer from 0 to 100


==== round ====
==== round ====
Line 164: Line 179:


=== Miscellaneous ===
=== Miscellaneous ===
==== date ====
''string'' '''date'''(''string'' format[, ''string'' time]);
Returns date and time according to the first argument. The format syntax is the same as PHP's date(). The optional argument may be a timestamp or string with date.
Example:
date("Y-m-d");                        // Returns current date e.g. "2007-11-20"
date("H:i:s");                        // Returns current time, e.g. "19:50:37"
date("Y-m-d", "1995-10-03T20:30:37"); // Returns date "1995-10-03"


==== if ====
==== if ====
Line 170: Line 194:
==== lc ====
==== lc ====
''Alias of [[#lowercase|lowercase();]]''
''Alias of [[#lowercase|lowercase();]]''
==== length ====
''number'' '''length'''(''string'' value);
Returns the number of characters of the string.
Example:
length("Foobar");  // Returns 6
length("");        // Returns 0
length("Foo bar."); // Returns 8


==== lowercase ====
==== lowercase ====
Line 199: Line 232:
  padding("2.40", 6, "left"); // Returns "2.40  "
  padding("2.40", 6, "left"); // Returns "2.40  "
  padding("1220.40", 6);      // Returns "1220.40"
  padding("1220.40", 6);      // Returns "1220.40"
==== date ====
''string'' '''date'''(''string'' format[, ''string'' time]);
Returns date and time according to the first argument. The format syntax is the same as PHP's date(). The optional argument may be a timestamp or string with date.
Example:
date("Y-m-d");                        // Returns current date e.g. "2007-11-20"
date("H:i:s");                        // Returns current time, e.g. "19:50:37"
date("Y-m-d", "1995-10-03T20:30:37"); // Returns date "1995-10-03"


==== precision ====
==== precision ====
Line 238: Line 262:
  uppercase("Foo Bar");          // Returns "FOO BAR"
  uppercase("Foo Bar");          // Returns "FOO BAR"
  uppercase("foo bar", "first"); // Returns "Foo bar"
  uppercase("foo bar", "first"); // Returns "Foo bar"
  uppercase("foo BaR", "words"); // Returns "Foo BaR"
  uppercase("foo baR", "words"); // Returns "Foo BaR"


[[Category:SigServer]]
[[Category:SigServer]]
128

edits

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.