House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Hex Number Formatting

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kamru Miah
01/08/2009 07:22 AM

Hello, I have requirement to use only 3-char to represent value above 999, so I decided to use FormatBaseN() function convert the number to hex (i.e. FFF will give upto 4096), but I can no longer use NumberFormat() to add leading zeros. Please let me know of any simple method/function to do this in ColdFusion. Thanks

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
John M Bliss
01/08/2009 08:15 AM

Replace(RJustify(yourHex, 3), " ", "0", "all") On Thu, Jan 8, 2009 at 6:11 AM, Kamru Miah <k.miah@csl.gov.uk> wrote: > Hello, I have requirement to use only 3-char to represent value above 999, > so I decided to use FormatBaseN() function convert the number to hex (i.e. > FFF will give upto 4096), but I can no longer use NumberFormat() to add > leading zeros. Please let me know of any simple method/function to do this > in ColdFusion. Thanks

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kamru Miah
01/08/2009 10:17 AM

John, that's simpler than I thought! Many thanks. :-) >Replace(RJustify(yourHex, 3), " ", "0", "all")

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
John M Bliss
01/08/2009 10:20 AM

I specialize in "simple."  ;-) On Thu, Jan 8, 2009 at 9:06 AM, Kamru Miah <k.miah@csl.gov.uk> wrote: > John, that's simpler than I thought! Many thanks. :-) > > >Replace(RJustify(yourHex, 3), " ", "0", "all")


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference