The currency symbol goes the wrong way in Hebrew

I am trying to combine two lines. One of them is a currency formatted using NSNumberFormatter, and the other is plain Hebrew text.

Take a look at this example image:

Screen shot

When each of the texts is displayed on a separate label, they are displayed correctly (the first and second UILabels of the image), but the currency symbol switches when I combine them (third UILabel in the image). Below is the code snippet that I used to create this example:

// test value
double value = 1234567.89;

// formatting to use currency markers
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
NSString *number = [formatter stringFromNumber:[NSNumber numberWithDouble:value]];

// example text
NSString *text = @"ברוכים הבאים!";

// combining they together to display
NSString *combined = [NSString stringWithFormat:@"%@ %@",text,number];

How could I combine them without this effect? It works fine when using languages ​​from left to right. This only happens in languages ​​from right to left.

+4

All Articles