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

  • SEARCH
  • Home
  • 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 8137227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:02:30+00:00 2026-06-06T11:02:30+00:00

In a Cocoa application, I am using a large number of Text Field with

  • 0

In a Cocoa application, I am using a large number of “Text Field with Number Formatter” objects. The objects improve the presentation of data by adding commas where appropriate so the number “123456” is presented as “123,456”. That is helpful when the number is of float type, and populated using the following code:

[OutR2C2 setFloatValue:MyVariable2 ];

Well, the number “123456.567” is presented as “123,456.567,” and the number “123456.5” is presented as “123,456.5.”.

I need to be able to specify that there will always be two digits after the decimal, as in 123,456.50 or 123,456.56 etc. for all numbers presented. In the properties for this object I don’t see any way to set the number of decimal points.

How can I do that while using the “Text Field with Number Formatter” object?

  • 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-06T11:02:38+00:00Added an answer on June 6, 2026 at 11:02 am

    You probably have something like this:

    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];

    [formatter setNumberStyle:NSNumberFormatterDecimalStyle];

    Followed by this:

    [formatter setFormat:@"###.##"];

    You need to switch that to:

    [formatter setFormat:@"###.00"];

    This will make your numbers always show two decimal places.

    Alternatively you can use:

    [formatter setFormat:@"##0.00"];

    If you want to show a 0 before the decimal point if it’s a <1 value. (For example .44 would be displayed as 0.44).

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

Sidebar

Related Questions

I am building a Cocoa application that will store customer data. I'm currently using
I created a CoreData application using the Cocoa Touch Template. I modified the included
I'm using the scripting bridge to query iTunes from my cocoa application. Sometimes iTunes
I'm trying to make a simple Cocoa application using XCode 3.2.3. In interface builder
I am not much familiar with developing application using cocoa on mac. Can some
I'm using a Table View in a Cocoa application. I have set the double
I am trying a simple application using NSArrayController and cocoa bindings. The application contains
I am developing a Cocoa Application using the latest version of Xcode 4, I
I want to create native Mac OS X application using Cocoa + Objective C
I have a Cocoa application for which I've changed the name. I'm using the

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.