Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2003
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Email this page
*Give us feedback
*
Sign up for our newsletter:

MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Formatting BaseForm Output

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39133] Formatting BaseForm Output
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Thu, 30 Jan 2003 01:07:40 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Evaluate the following in Mathematica  

In[1]:=
    BaseForm[3914, 16]

and the output looks like  (f4a  with 16 for a subscript).
What if you wanted the output above formatted as one of the following
   0xf4a,  0x0f4a,  0xF4A, 0x0F4A   which are often used by programmers.

As far as I can tell it isn't possible to do that using BaseForm options 
(there are none), MakeBoxes or Format definitions.  I could, without too
much 
trouble, make my own function  HexForm[n]  that would compute the hex digits

and format the output.  It would just be more elegant to use the built-in 
BaseForm if possible.

---
Thanks,
   Ted Ersek



  • Prev by Date: Re: Unprotect Plus, no automatic collection
  • Next by Date: Re: Warning message on UnicodeLanguageFontMapping.tr
  • Previous by thread: mathematica on tabletPC
  • Next by thread: Derivative help


  •  © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy