【问题标题】:Price Formatting Google Content API for Shopping价格格式 Google Content API for Shopping
【发布时间】:2013-08-21 16:51:37
【问题描述】:

任何 Google Content API for Shopping 专家?

使用 Google 提供的 GShoppingContent.php 库提交大于 999.99 的价格时,我收到一个解析错误,即 API 无法读取价格格式。

如果我将价格四舍五入,即使没有小数位,即:只有 4 位数字,它会成功提交,但会因为与网站价格不符而被拒绝。

Google 购物上的数字格式似乎表明他们可能需要千位分隔符,因为它们的价格为 1,234.99,所以我也尝试了这种格式:

$price = number_format ($price, 2, '.', ',');

但我仍然得到错误。

有人知道如何解决这个问题吗?

【问题讨论】:

    标签: php google-api google-shopping


    【解决方案1】:

    $price = number_format ($price, 2, '.', '');

    $price = number_format ($price, 2);

    默认自动添加千位分隔符,我错过了。

    【讨论】:

      猜你喜欢
      • 2023-03-07
      • 2017-03-09
      • 2017-04-12
      • 2014-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-08
      相关资源
      最近更新 更多