~unity-api-team/pay-ui/first-branch

« back to all changes in this revision

Viewing changes to app/payui.qml

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2014-09-15 21:51:03 UTC
  • mfrom: (35.2.2 usd-prices)
  • Revision ID: tarmac-20140915215103-y2yvz2v6klkof6yw
Use a Number object with the locale to format the currency value.
Use "US$" as the symbol for displaying the currency value. Fixes: https://bugs.launchpad.net/bugs/1362716, https://bugs.launchpad.net/bugs/1368363.

Approved by Alejandro J. Cura, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
        id: purchase
89
89
 
90
90
        onItemDetailsObtained: {
 
91
            var loc = Qt.locale();
 
92
            var pnum = Number.fromLocaleString(loc, price);
91
93
            checkout.itemTitle = title;
92
94
            checkout.itemSubtitle = publisher;
93
 
            checkout.price = "$" + price;
 
95
            checkout.price = pnum.toLocaleCurrencyString(loc, "US$");
94
96
            payment.itemTitle = title;
95
97
            payment.itemSubtitle = publisher;
96
 
            payment.price = "$" + price;
 
98
            payment.price = pnum.toLocaleCurrencyString(loc, "US$");
97
99
            direct.itemTitle = title;
98
100
            direct.itemSubtitle = publisher;
99
 
            direct.price = "$" + price;
 
101
            direct.price = pnum.toLocaleCurrencyString(loc, "US$");
100
102
        }
101
103
 
102
104
        onPaymentTypesObtained: {