Expression Language
Also available as:
PDF

toRadix

Description: [.description]#Converts the Subject from a Base 10 number to a different Radix (or number base). An optional second argument can be used to indicate the minimum number of characters to be used. If the converted value has fewer than this number of characters, the number will be padded with leading zeroes.

If a decimal is passed as the subject, it will first be converted to a whole number and then processed.#

Subject Type: Number

Arguments:

  • Desired Base : A Number between 2 and 36 (inclusive)

  • Padding : Optional argument that specifies the minimum number of characters in the converted output

Return Type: String

Examples: If the "fileSize" attributes has a value of 1024, then the following Expressions will yield the following results:

Table 1.16. Table 16. toRadix Examples

Expression

Value

${fileSize:toRadix(10)}

1024

${fileSize:toRadix(10, 1)}

1024

${fileSize:toRadix(10, 8)}

00001024

${fileSize:toRadix(16)}

400

${fileSize:toRadix(16, 8)}

00000400

${fileSize:toRadix(2)}

10000000000

${fileSize:toRadix(2, 16)}

0000010000000000