IAchievement percentCompleted returns an int instead of double. I need those decimals

I am keeping track of one achievement which needs to be completed after doing a certain task 1000 times. So that means each progress is 0.1d. Now I have no problem posting a progress score with decimal. Cause if I report of 4.1d, it shows in the log correctly:

Reporting achievement de.company.testapp.achievement1, with 4.100000
Successfully reported progress

As I don’t want to save the progress/counter inside the app, I try to add each progress of 0.1d on top of the progressCompleted but when I try to retrieve it, it gives me a whole number of 4. I tried to force showing the decimal value but it really is only showing 4.

Console.Log("current score string : " + achievement.percentCompleted.ToString("N2"));

Shows:
current score string : 4.00

Console.Log("current score full achievement : " + achievement.ToString());

Shows:
current score full achievement : de.company.testapp.achievement1 - 4 - False - False - 03/27/2013 16:21:02

It says here: http://docs.unity3d.com/Documentation/ScriptReference/IAchievement-percentCompleted.html that percentCompleted is of double type. So why is it dropping the decimal places?

I’m using Unity 4.1.1f4 and its GameCenterPlatform.

Please someone enlighten me.

Have you tried using string.Format() to create your log line? It should give you better control over the output.

  • foreach(IAchievement achievement in achievements)*
  • {*
  • string str = String.Format(“{0}”, achievement.percentCompleted);*
  • Console.Log("Achievement percentComplete: " + str);*
  • }*

I already did. It really is just integer value. The two achievements I’m testing have 100% and 6% percentCompleted. It just returned 100 and 6 whole number.

I just found this and it says it really returns whole number:

It’s an old post though so I wonder if someone figured out what to do.

Was there any solution for this? I am also stuck with the exact same problem.