question

lingzhuzhang2020 avatar image
lingzhuzhang2020 asked

ValueToDate calculation bug in Russian ruble?

I tested our game before and it seems to be all good with USD. In google play, the IAP prices are auto calculated from USD, so they should also be good.

Today I found an android player whose valueToDate is 0.08 USD. That player is from Russia. From 1 transaction's json record, I found that

"TransactionTotal": 399,

Which should be RUB 399.00. But instead, the summary shows "3.99 RUB".

I think our local code should be correct. There are only a few lines of them. All values are get from metadata. No "divided by 100" was operated. And as I mentioned, the valueToDate value is correct when we tested with USD.

Any one has the similar problem?

In-Game Economy
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Andy avatar image
Andy answered

For Real Money prices, we use whole numbers of the currency's fractional unit (https://en.wikipedia.org/wiki/List_of_circulating_currencies). For rubles, that would mean setting a price to 399 is actually setting it to 3.99 rubles (or 399 kopeks).

If you still think something is wrong, you can share your title id and a sample player id and I can investigate.

6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lingzhuzhang2020 avatar image lingzhuzhang2020 commented ·

Thanks. I don't know much about Russian currency but the ValueToDate seems wrong. Our title id is 8EC, and the player id is 49457BFA34B27F31. His valueToDate is $0.08, but actually he has bought a $4.99(RUB 399) bundle and a $0.99(RUB 75) bundle. I checked the revenue data at google play console, it shows руб.399.00 and руб.75.00, seems fine.

Also, 496EA52CAEFBCF16 this is my testing player id. I tested buying bundles with USD. ValueToDate is $6.97, is correct.

0 Likes 0 ·
Andy avatar image Andy ♦♦ lingzhuzhang2020 commented ·

In your call to ValidateGooglePlayPurchase, you're passing in 399 as the PurchasePrice and RUB as the CurrencyCode, correct? If you intended to set the purchase price to 399 rubles, you would need to pass in 39900. As I mentioned earlier, we interpret real money currencies as a whole number of the fractional unit.

0 Likes 0 ·
lingzhuzhang2020 avatar image lingzhuzhang2020 commented ·

Hi, this is an old thread, but I find more related info today, I'd like to post it here. So, let me state this issue from the beginning. when I post this question back in September, I found Russian ruble has problem with valueToDate. Later, I found all non-USD currencies has the same issue. They are all devided by 100 when calculated.

We have some real players now. When we read the "valueToDate" in playfab's GameManager, United States' payed player's valueToDate are like $0.99 or more, but other countries' payed players valueToDate are like $0.04, $0.12, which are impossible because our cheapest item is $0.99. Actually they are all divided by 100. But (for example) when I try to search "totalValueToDateInUSD: >10 AND CN" in Players, it does give me meanful data - it gives me many Chinese players whose VTD is larger than $0.10.

As a result, I think it looks like, there is inconsistency between this VTD value in different places. We haven't use playfab's analytics data related to payments since game releasing, because I couldn't solve the "divided by 100" issue. Is it possible to get any workaround with it?

0 Likes 0 ·
Andy avatar image Andy ♦♦ lingzhuzhang2020 commented ·

In one of the real money purchase examples I saw in your event history, you were passing in a PurchasePrice of 40 and a CurrencyCode of CNY. This will result in the transaction being recorded as 0.40 CNY, or about 0.06 USD. If you actually intended to record the transaction as 40.00 CNY, you should provide a PurchasePrice of 4000.

0 Likes 0 ·
lingzhuzhang2020 avatar image lingzhuzhang2020 Andy ♦♦ commented ·

Thanks for your reply. When I searched for "totalValueToDateInUSD: >10", I used 10 instead of 0.1, but I think it actually gives me the result of totalValueToDateInUSD: >0.1. That's why I feel I should post something here.

(Because, BTW, the PurchasePrice is directly pulled from UnityIAP purchasedProduct.metadata.localizedPrice, and I think it is not right to coding like

if(USD){

send price;

}

else{

send price*100;

}

I can't guarantee the correctness and stability unless someone guarantee it to me)

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.