»home«  »clone and scan Objects - get name of constructor«


download: "jsApi.String.trim.js" [2.17 kByte]
download: "jsApi.String.trim.dev.zip" [4.26 kByte]
download: "jsApi.NumberString.flexibleConverting.js" [6.73 kByte]
download: "jsApi.NumberString.flexibleConverting.dev.zip" [16.04 kByte]

view: the examples


     
flexibleRound()

   
 
  • unfortunataly Math doesn't allow prototyping on itself - so there is no way for flexible number-formatting with Math;
  • leider laesst Math keinen prototypen zu, so dass keine flexible formatierungs-methode geschrieben werden kann;
 
Number.flexibleRound()
  • without any arguments the method behaves like the already known Math.round();
  • ohne parameter-angabe verhaelt sich die methode analog zur bereits bekannten Math.round();
 
  • nonesense-parameters (negative numbers, floats, etc.) will result as just mentioned;
  • sinnlose parameter (negative und fliesskomma-zahlen, ueberschreitung des zahlenraumes) werden ebenso behandelt;
 
  • accepts a parameter of type Integer that represents the number of digits behind the comma that will be rounded to and returns the roundet value of Number;
  • die methode erwartet einen ganzzahligen parameter, der die anzahl der nachkomma-stellen enthaelt, auf die es zu runden gilt und liefert einen gerundeten zahlenwert zurueck;
 
String.flexibleRound()
  • everything said about Number.flexibleRound() applies here as well - except the type of the return-value;
  • alle eigenschaften der oben besprochenen Number.flexibleRound() gelten auch hier - bis auf den typ des rueckgabe-wertes;
 
  • tries to convert the string internly into a valid number;
  • if this fails the return-value will be NaN;
  • otherwise the String-formatted result gets returned;
  • while trying to convert the string into a number the method behaves like parseFloat();
  • versucht, den string intern in eine brauchbare zahl umzuwandel;
  • misslingt dies, lautet der rueckgabe-wert NaN;
  • anderenfalls ist dieser wert das als String formatierte ergebnis;
  • bei der umwandlung von string in zahl wird das verhalten aus parseFloat() uebernommen;

     
fixedDigits()

   
 
Number.fixedDigits()
  • accepts combinations of 3 or less parameters;
  • akzeptiert kombinationen aus bis zu maximal 3 parametern;
 
  • a integer-type-parameter always gets interpreted as amount of forced digits (f.i.:(4) --> 586.0100) behind the comma;
  • the first string-type-parameter gets used as comma by the formatting-process;
  • the second string-type-parameter gets used as separator while dividing the number visually in blocks of thousends;
  • ein parameter vom typ integer wird immer als anzahl der erzwungenen nachkommastellen (z.b.:(4) --> 586.0100) interpretiert;
  • der erste string-parameter wird bei der formatierung als komma verwendet;
  • der zweite string-parameter wird als trenn-zeichen fuer die visuelle teilung der zahl in tausender-bloecke genutzt;
 
  • returns always a String that represents a formatted number;
  • liefert immer einen als String formatierten zahlenwert zurueck;
 
String.fixedDigits()
  • everything said about Number.fixedDigits() applies here as well;
  • alle eigenschaften der oben besprochenen Number.fixedDigits() gelten auch hier;
 
  • tries to convert the string internly into a valid number;
  • if this fails the return-value will be NaN;
  • otherwise the String-formatted result gets returned;
  • while trying to convert the string into a number the method behaves like parseFloat();
  • versucht, den string intern in eine brauchbare zahl umzuwandel;
  • misslingt dies, lautet der rueckgabe-wert NaN;
  • anderenfalls ist dieser wert das als String formatierte ergebnis;
  • bei der umwandlung von string in zahl wird das verhalten aus parseFloat() uebernommen;

     
forceToNumber()

   
 
String.forceToNumber()
  • tries to convert a formatted string that represents a decimal-number into a number;
  • versucht, einen formatierten dezimalzahl-string in einen zahlenwert umzuwandeln;
 
  • returns this value of type Number or returns NaN;
  • liefert diesen wert vom typ Number oder aber NaN zurueck;

     
leftTrim()

   
 
String.leftTrim()
  • cuts all leading white-spaces of a string;
  • schneidet alle fuehrenden white-spaces einer zeichenkette ab;

     
rightTrim()

   
 
String.rightTrim()
  • cuts all trailing white-spaces of a string;
  • schneidet alle einer zeichenkette folgenden white-spaces ab;

     
basicTrim()

   
 
String.basicTrim()
  • combination of the above 2 functions String.leftTrim() and String.rightTrim();
  • kombiniert String.leftTrim() und String.rightTrim();

     
superTrim()

   
 
String.superTrim()
  • behaves like String.basicTrim();
  • additionally all white-spaces within a string are forced to shrink each to a single-"blank"-space;
  • wie String.basicTrim();
  • zusaetzlich werden alle white-spaces innerhalb einer zeichenkette auf jeweils ein "blank" "eingedampft";

     
removeWhiteSpaces()

   
 
String.removeWhiteSpaces()
  • does what the methods name promisses;
  • entfernt jedes white-space -zeichen;


 
download: "jsApi.String.trim.js" [2.17 kByte]
download: "jsApi.String.trim.dev.zip" [4.26 kByte]
download: "jsApi.NumberString.flexibleConverting.js" [6.73 kByte]
download: "jsApi.NumberString.flexibleConverting.dev.zip" [16.04 kByte]

view: the examples


»home«  »clone and scan Objects - get name of constructor«




provided by peterS.  -  august 2002 - june 2003  -  pseliger@gmx.net