定制 markus-g/price-parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

markus-g/price-parser

最新稳定版本:0.1.1

Composer 安装命令:

composer require markus-g/price-parser

包简介

Parses prices or money strings

README 文档

README

PHP 5.3+ library to parse price or money strings and get their currency and amount!

<?php
use PriceParser\Price;

$priceWithCurrency = '12,499,50 €';
$price = new Price($priceWithCurrency);

//float value e.g. 15.20
$price->getAmount();

//currency symbol, e.g. $ or €
$price->getCurrencySymbol();

//currency iso code, e.g. EUR or USD
$price->getCurrencyIsoCode();

//currency name, e.g. Euro or US Dollar
$price->getCurrencyName();

//the raw value, e.g. 12,499,50 €
$price->getValue();

//price is valid if a currency can be found and amount is not empty or null
$price->isValid();

Installation

Install the library using composer. Add the following to your composer.json:

{
    "require": {
        "markus-g/price-parser": "0.1.*"
    }
}

Now run the install command.

$ composer.phar install

统计信息

  • 总下载量: 14.63k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2015-02-05