I'm trying to get a string parsed into a NSNumber that has the % character in the end where I can use the in the ShinobiChart value property of the series.
Given the following code, I'm creating the NSNumberFormatter:
var formatter = new NSNumberFormatter ();
formatter.NumberStyle = NSNumberFormatterStyle.Percent;
var locale = new NSLocale ("en_US");
formatter.Locale = locale;
Now, I'll try to use the formatter to get the value for the chart slice label:
var value = formatter.NumberFromString (answer.RepliesShare.ToString () + "%");
This will give me the value 0.33... The point is, if I remove the "%" from the string, I'll get null on the value.
So, I need get a NSNumber that has the value of (i.e.) 30%(in other words, numberString+"%").
How can I get it?
To be more clear, I'm trying to achieve this:
Since ShinobiChart takes a Value of Type NSNumber and my RepliesShare is a decimal I'm trying just convert my decimal from 33.00 to 33%. The ShinobiChart don't take a string, otherwise I would have it handled. I found that NSNumber can be formatted with NSNumberFormatted so I thought I can use it since the Chart takes a number.