2017 © Pedro Peláez
 

library price-parser

Parses prices or money strings

image

markus-g/price-parser

Parses prices or money strings

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

PriceParser

PHP 5.3+ library to parse price or money strings and get their currency and amount!, (*1)

<?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:, (*2)

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

Now run the install command., (*3)

$ composer.phar install

The Versions

12/03 2016

dev-master

9999999-dev

Parses prices or money strings

  Sources   Download

proprietary

The Requires

  • php >=5.3

 

by Markus G.

parser locale currency money string float price

12/03 2016

0.1.1

0.1.1.0

Parses prices or money strings

  Sources   Download

proprietary

The Requires

  • php >=5.3

 

by Markus G.

parser locale currency money string float price

03/02 2015

0.1.0

0.1.0.0

Parses prices or money strings

  Sources   Download

proprietary

The Requires

  • php >=5.3

 

by Markus G.

parser locale currency money string float price