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 6539427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:51:30+00:00 2026-05-25T10:51:30+00:00

I have a NSString I am getting from an array. There are multiple string

  • 0

I have a NSString I am getting from an array. There are multiple string objects in the array. I want to change the format of the string I get from array and display that new formatted string on UILabel. Let me give an example:

String in array: 539000
String I want to display: 5.390.00

Now the problem is that the string I get from array may be 539000, 14200 or 9050. So the string I want to get are: 5.390.00, 142.00, 90.50.

The correct format is to place a **.** before last two digits, again place a **.** before 3 digits from first **.**.

  • 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-05-25T10:51:30+00:00Added an answer on May 25, 2026 at 10:51 am

    Try below code it will help

    Objective-C

    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; 
    [formatter setGroupingSeparator:@"."];
    [formatter setGroupingSize:2];
    [formatter setUsesGroupingSeparator:YES];
    [formatter setSecondaryGroupingSize:3];
    
    NSString *input = @"539000";
    NSString *output = [formatter stringFromNumber:[NSNumber numberWithDouble:[input doubleValue]]];
    NSLog(@"output :: %@",output);// output :: 5.390.00 
    

    Swift3

    let formatter = NumberFormatter()
        formatter.groupingSeparator = "."
        formatter.groupingSize = 2
        formatter.usesGroupingSeparator = true
        formatter.secondaryGroupingSize = 3
    
        let input = 539000
        let output = formatter.string(from: NSNumber.init(value: input))
        print("output :: \(output!)")// output :: 5.390.00 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a string in my call from an array. But have
I have an Array of NSDictionary objects. These Dictionaries are parsed from a JSON
I have written some code that pulls info from a plist file and does
I want to have generalised email templates. Currently I have multiple email templates with
I am trying to access and change a array from a different class file.
I have NSString's in the form of Johnny likes eating apples . I want
I have a Sectioned Tableview sourced from a pList which I want to drill
I'm getting garbage values when manipulating some of my NSString objects. I think the
If I have an NSString with a text file in it, how do I
I have the following example class: Test.h: @interface Test : UIButton { NSString *value;

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.