• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Outputting an unsigned long long
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Outputting an unsigned long long


  • Subject: Outputting an unsigned long long
  • From: Clark Mueller <email@hidden>
  • Date: Thu, 20 Jun 2002 20:07:01 -0600

I am having a problem outputting an unsigned long long, and I am at a loss as to how to remedy the problem. I create an NSString using the ANSI formatters:

[NSString stringWithFormat:@"%.1f GB (%d bytes)", (float)totalPhysical/1024/1024/1024, (int)totalLogical]

The totalPhysical, when used as the float value, is always displayed correctly (as "x.x GB", so there is no problem with the actual size that is assigned to the variable. The problem seems to be when I am formatting the "%d bytes" part. This value is displayed correctly up to a certain point, after which it becomes unpredictable, and has become a negative value. I have not dealt with outputting an unsigned long long before; is there a special trick I should know?

Thanks,

Clark
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Outputting an unsigned long long
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: Panels shared by documents
  • Next by Date: Re: Outputting an unsigned long long
  • Previous by thread: Re: Knowing when a CFSocket has died
  • Next by thread: Re: Outputting an unsigned long long
  • Index(es):
    • Date
    • Thread