Re: converting from decimal to hexadecimal
Re: converting from decimal to hexadecimal
- Subject: Re: converting from decimal to hexadecimal
- From: Gregory Weston <email@hidden>
- Date: Tue, 02 Sep 2008 13:53:04 -0400
Ronnie B wrote:
Hello,
Is there an easy way to convert a decimal number to hexadecimal.
NSNumberFormatter does not have an api for that. Any advice.
Depends on what you mean. The words "decimal" and "hexadecimal" don't
have any implications beyond the presentation of data. In memory,
integers don't have any particular base; they just "are." So if
you've got a integer and want to display the hex representation of
it, use something like NSString's stringWithFormat: with a format
that includes the code %x. If you've got an NSString that represents
a base 10 number, you can send it an intValue message, thus getting
your input for stringWithFormat:.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden