Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8131361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:04:25+00:00 2026-06-06T09:04:25+00:00

I’m having issues with this when the numbers are large. For example if the

  • 0

I’m having issues with this when the numbers are large. For example if the number is 3670000000, I want the label to be 3,670,000,000. When the numbers are large it gives me a value of 2,147,483,657. I’m sure it must be a variable length issue. I tried using long long int for numC. Any suggestions would be greatly appreciated. Thanks.

int numC;
NSNumberFormatter *formatter = [NSNumberFormatter new];
[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
NSString *valuestring= [NSString stringWithFormat:@"%@", [[values objectAtIndex:indexA] objectForKey:@"hits"]];
numC=[valuestring intValue];


NSString *results = [formatter stringFromNumber:[NSNumber numberWithInteger:numC]];    
label1.text =results;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:04:26+00:00Added an answer on June 6, 2026 at 9:04 am

    The int type cannot hold a value greater than 2,147,483,657. You could use an unsigned int and the maximum value would be 4,294,967,295. Look here for more information. You could try this too to extend the range of the data type:

    long long int numC;
    
    //Number formatter and string operations
    
    numC = [valuestring longLongValue];
    
    NSString *results = [formatter stringFromNumber:[NSNumber numberWithLongLong: numC]];    
    label1.text = results;
    

    Additionally, if none of the values you are retrieving contain a negative value, you could make it an unsigned long long int. In that case, make your code this:

    unsigned long long int numC;
    
    //Number formatter and string operations
    
    numC = [valuestring longLongValue];
    
    NSString *results = [formatter stringFromNumber:[NSNumber numberWithUnsignedLongLong: numC]];    
    label1.text = results;
    

    Also make sure that in this line…

     NSString *valuestring= [NSString stringWithFormat:@"%@", [[values objectAtIndex:indexA] objectForKey:@"hits"]];
    

    …the value you are retrieving is a long long int.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any issues in having a large number (say 50) of script tags
Still having issues with this problem. Please help if you can. So I am
Im having issues getting this to work, maybe its not even possible? I have
Having issues referencing $(this) from within a the nested ajax 'success' function... I know
This might be a simple answer, but I am having some issues writing this
I am having issues with understanding how to make this happen. Basically we have
I know this probably has been asked before but I am having issues with
this is the second game that I'm having issues with in the same area...
I am having issues, could you point me in the right direction? EDIT: This
I am having the same issues as per this question: WCF not deserializing JSON

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.