Description

Converts number to a string, in the base specified by radix.

Returns

String that represents number, in the base radix.

Category

Display and formatting functionsMathematical functionsString functions

Function syntax

FormatBaseN(number, radix)

See also

InputBaseN

Parameters

Parameter

Description

number

Number to convert

radix

Base of the result

Example

<cfoutput>
  (FormatBaseN(10,2)) is : 
  <cfscript>
      writeOutput(FormatBaseN(10,2)); //Result 1010
  </cfscript>

  <br>(FormatBaseN(1024,16)) is : 
  <cfscript>
      writeOutput(FormatBaseN(1024,16)); //Results 400
  </cfscript>
  
  <br>(FormatBaseN(125,10)) is : 
  <cfscript>
      writeOutput(FormatBaseN(125,10)); //Results 125
  </cfscript>
  
  <br>(FormatBaseN(10.75,2)) is : 
  <cfscript>
      writeOutput(FormatBaseN(10.75,2)); //Results 1010
  </cfscript>
</cfoutput>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy