Manuals/calci/ZeroPad

From ZCubes Wiki
Jump to navigation Jump to search
ZeroPad(String,PadWith,PadLength)


  • where Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle String} is the input string,
  • Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle PadWith} is the number or a string or a character with which the given string is to be padded.
  • Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle PadLength} is the total length of the resultant string.

Description

  • This function pads the given string with mentioned string or character or number till Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle PadLength} is satisfied.
  • For non-numeric value of , it should be mentioned in double quotes.

e.g ZeroPad("##",4,6) displays 4444##.

  • Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle PadWith} can be a number, a character or a string. Non-numeric value should be mentioned in double quotes.

e.g ZeroPad(55,"z",9) displays zzzzzzz55.

  • If Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle PadLength} is lesser than the actual length of the string, it is ignored and the string is displayed as it is.

e.g ZeroPad(567,"z",1) displays 567.

Examples

  1. =ZeroPad(4,0,6) = 000004
  2. =ZeroPad(678,"a",8) = aaaaa678
  3. =ZeroPad("#@$",1,5) = 11#@$
  4. =ZeroPad(99,45.5,5) = 45.545.545.599
  5. =ZeroPad("World","Hello",15) = HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloWorld

Related Video

How to add leading Zeros

See Also


References