vistag/price-parser
Composer 安装命令:
composer require vistag/price-parser
包简介
Parse string and return separated price and currency
关键字:
README 文档
README
Extract price and currency from given string
Installation
You can install this package via composer using this command:
composer require vistag/price-parser
Usage
use Vistag\PriceParser\PriceParser; $priceParser = new PriceParser('120 Kč'); $priceParser->getPrice(); // 120 $priceParser->getCurrency(); // CZK $priceParser = new PriceParser('$ 1,210,000.10'); $priceParser->getPrice(); // 1210000.1 $priceParser->getCurrency(); // USD $priceParser = new PriceParser('foobar'); $priceParser->isValid(); // false $priceParser = new PriceParser('12312'); $priceParser->isValid(); // true $priceParser->getPrice(); // 12312 $priceParser->getCurrency(); // null
Support
If you believe you have found an issue, please report it using the GitHub issue tracker, or better yet, fork the repository and submit a pull request.
If you're using this package, I'd love to hear your thoughts. Thanks!
License
The MIT License (MIT). Vistag.com
统计信息
- 总下载量: 3.17k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-29