<?php

require_once 'IS4NaC.php';

###### Tests and usage-examples ##############

$inputs=array(
	123456.789,
	-123456.789,
	'123456.789',
	'123456,789',
	'123.456,789',
	'123,456.789',
	'123 456.789',
	'123 456,789',
	"123'456,789",
	"123'456.789",
	"-123'456,789",
	"- 123'456.789",
	'123456.789-',
	'123456.789 -'	
);

echo "############# Function ############################\n";

foreach ($inputs as $v) {
	print $v . ' : ' . Is4NaC( $v, 2, 'USD %01.2f' ) . "\n";
	print $v . ' : ' . Is4NaC( $v, 0 ) . "\n";
	print $v . ' : ' . Is4NaC( $v, 0, false ) . "\n";
	print $v . ' : ' . Is4NaC( $v, 2 ) . "\n";
}


echo "############# Class ############################\n";

$is = new Is4NaC();
$is -> outputFormat = '%01.2f EUR';
$is -> setDecimals (2);

foreach ($inputs as $v) {
	print $v . ' : ' . $is -> setValue($v) . ' : ' .  $is->getValueRounded() . "\n";
}

echo "############# Finished ############################\n";
