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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:46:22+00:00 2026-05-12T20:46:22+00:00

For example, I have an NSDecimal myDecimal. Lets say it represents something like -1234567.89

  • 0

For example, I have an NSDecimal myDecimal. Lets say it represents something like “-1234567.89”

How can I get a clean string representation of that decimal without any beautification / formatting? No localization? Floating point symbol = . and rest only numbers from 0 to 9, and eventually an – if it is negative? I need that string in strict technical manner. A number like 123456789876554432123456789.2231 should therefore not look like nice formatted “123,456,789,876,554,432,123,456,789.2231”. You get the point right?
I don’t want any formatting. I’m trying all day now to get that right but everything I find always has to do with formatting. So how’d you guys do that?

  • 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-12T20:46:22+00:00Added an answer on May 12, 2026 at 8:46 pm

    I don’t believe there is such a thing as a “clean” string representation independent of specifying the locale. As many Europeans would point out, 123.45 should be written as 123,45 (using , instead of . for the decimal location). NSDecimalString() (which can be found in the Foundation Functions Reference) takes, as a second parameter a locale specification. If some locale uses the format you desire, pass that locale as the second parameter (see the Internationalization Guide for more info on locales).

    Alternatively, you can use an NSNumberFormatter, which will give you more controll over the string representation.

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

Sidebar

Related Questions

Say for example I have the following string: var testString = Hello, world; And
For example I have a simple class like public class Person{ public int Age
Let's say I for example have this class that generates Fibonacci numbers: public class
For example I have to do it manually like this: function checkDivUppersClosed() { var
For example i have this string: $test_str = num Test \n num Hello \n
I'm using the Silverlight UnitTest framerwork does anyone have a good example have how
Example: You have a shortcut s to SomeProgram in the current directory. In cmd.exe
Example I have Person , SpecialPerson , and User . Person and SpecialPerson are
Example: I have two shared objects (same should apply to .dlls). The first shared
I have example of code below. <script type=text/javascript src=assets/scripts/somescript.php>. </script> So, will my browser

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.