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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:46:24+00:00 2026-05-16T17:46:24+00:00

Converting numbers to strings is no problem, but the string created uses ascii numbers.

  • 0

Converting numbers to strings is no problem, but the string created uses ascii numbers. I am inserting the number in a Japanese sentence. The character itself is correct, say 3, for example, but the width and positioning should be a little different when typing in Japanese. As a result the number looks cramped up against the following character. Is there any clever non-manual way to convert 1 to 1, 2 to 2, 3 to 3, etc.?

  • 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-16T17:46:24+00:00Added an answer on May 16, 2026 at 5:46 pm

    For lack of any better ideas, I wrote up a not-so-elegant category solution that manually converts each character. If anyone has a better solution, please let me know.

    #import "NSNumber+LocalizedNumber.h"
    
    @interface NSNumber()
    -(NSString*)convertRepresentation:(unichar)character;
    @end
    
    @implementation NSNumber (LocalizedNumber)
    
    -(NSString *)localizedNumber {
        NSString *languageCode = [[NSLocale preferredLanguages] objectAtIndex:0];
        if([languageCode isEqualToString:@"ja"]) {
            NSString *numberString = [self stringValue];
            NSUInteger length = [numberString length];
            NSMutableString *convertedString = [[NSMutableString alloc] initWithCapacity:length];
            for(NSUInteger index = 0; index < length; index++) {
                unichar character = [numberString characterAtIndex:index];
                [convertedString appendString:[self convertRepresentation:character]];
            }
            return [convertedString autorelease];
        }
        return [self stringValue];
    }
    
    -(NSString*)convertRepresentation:(unichar)character {
        switch (character) {
            case '1':
                return @"1";
            case '2':
                return @"2";
            case '3':
                return @"3";
            case '4':
                return @"4";
            case '5':
                return @"5";
            case '6':
                return @"6";
            case '7':
                return @"7";
            case '8':
                return @"8";
            case '9':
                return @"9";
            case '0':
                return @"0";
            default:
                return nil;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen a number of ways of converting an Object to a String in
I have the following problem: i need to convert a decimal number to string.
I'm having a problem with converting some string short time values to a 24
MS Excel has eaten my head. It is randomly converting numbers into scientific notation
I have a function that returns log10 values. On converting them to normal numbers,
I am converting an open source Java library to C#, which has a number
I'm converting a legacy app from ISO-8859-1 to UTF-8, and I've used a number
Converting to ODB.NET from System.Data.OracleClient and need help converting my connection string. Here is
My problem seems to be very simple but I'm stuck here. I have a
I'm currently learning C++ and i run into the simple problem of converting an

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.