Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

An error occurs Because price_amount_micros is large. #70

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions unity_plugin/unity_src/Assets/Plugins/OpenIAB/SkuDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ private void ParseFromJson()
var json = new JSON(Json);
if (string.IsNullOrEmpty(PriceValue))
{
float val = json.ToFloat("price_amount_micros");
val /= 1000000;
PriceValue = val.ToString();
string microPrice = json.ToString("price_amount_micros");
PriceValue = microPrice.Substring (0, microPrice.Length - 6);
}
if (string.IsNullOrEmpty(CurrencyCode))
CurrencyCode = json.ToString("price_currency_code");
Expand All @@ -99,4 +98,4 @@ public override string ToString()
ItemType, Sku, Title, Price, Description, PriceValue, CurrencyCode);
}
}
}
}