Em Andamento

PHP function

I need a PHP function to be able to convert a humanly recognisable price into a price stripped of currency symbols and commas or return an error message.

## Deliverables

Deliverables:

I need a PHP function which uses regular expressions to ensure that data submitted via a form field is stripped of all non-numerical characters (except ".") so that what remains is a numerical "price". For example:

$123.45 becomes 123.45 ($ sign removed)

£123.45 becomes 123.45 (£ sign removed)

1,234.00 becomes 1234.00 (comma removed)

£1,234.03 becomes 1234.03 (£ sign and comma removed)

$1,234.03 becomes 1234.03 ($ sign and comma removed)

1,234.015 becomes 1234.02 (comma removed, amount rounded up to 2 decimal places)

etc...

The function must ensure that all submitted values are greater than 1.00.

The function should be robust enough to handle invalid/non-sensical data such as:

££123.00

adfdfd

123ggjk

123..40

000.755

and when confronted with similar non-sensical data the function should echo a simple error message.

In short, the function should be able to convert a humanly recognisable price into a price stripped of currency symbols and commas or return an error message.

1) Complete source code of all work done.

2) Complete ownership and distribution copyrights to all work purchased.

Habilidades: Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Ver mais: uses of regular expressions, regular expressions in c, regular expressions example, regular expressions c, php function for, example regular expressions, c regular expressions, php function , currency source code, echo sign, simple sign php form, php code currency, php rounded code, code rounded php, stripped, 1234, php rounded, code rounded, rounded code, function price, simple php sign form, php simple sign form, simple php form sign, function symbols, short function

Acerca do Empregador:
( 127 comentários ) United Kingdom

ID do Projeto: #2965608

Premiar a:

lehuray

See private message.

$7 USD em 3 dias
(2 Avaliações)
0.8

21 freelancers estão ofertando em média $18 para este trabalho

mihaiscortaru

See private message.

$16.99 USD in 3 dias
(159 Comentários)
6.0
codergames

See private message.

$21.25 USD in 3 dias
(27 Comentários)
5.9
wladh

See private message.

$42.5 USD in 3 dias
(74 Comentários)
5.6
roystervw

See private message.

$25.5 USD in 3 dias
(32 Comentários)
5.1
michaeldweber

See private message.

$25.5 USD in 3 dias
(35 Comentários)
4.6
nonsievw

See private message.

$38.25 USD in 3 dias
(11 Comentários)
3.6
gmorkster2

See private message.

$3.83 USD in 3 dias
(16 Comentários)
3.9
gonesoft

See private message.

$12.75 USD in 3 dias
(4 Comentários)
2.7
webittechvw

See private message.

$3.4 USD in 3 dias
(10 Comentários)
2.6
slavefishy

See private message.

$17 USD in 3 dias
(6 Comentários)
1.5
ekinolik

See private message.

$17 USD in 3 dias
(1 Comentário)
0.0
prb112

See private message.

$8.5 USD in 3 dias
(0 Comentários)
0.0
ssnoyes

See private message.

$8.5 USD in 3 dias
(0 Comentários)
0.0
vw921496vw

See private message.

$42.5 USD in 3 dias
(0 Comentários)
0.0
lucian1633

See private message.

$25.5 USD in 3 dias
(0 Comentários)
0.0
claudiuraveica

See private message.

$6.8 USD in 3 dias
(0 Comentários)
0.0
vw935237vw

See private message.

$8.5 USD in 3 dias
(0 Comentários)
0.0
mizhgun

See private message.

$4.25 USD in 3 dias
(0 Comentários)
0.0
tokarev

See private message.

$42.5 USD in 3 dias
(0 Comentários)
0.0
drakia

See private message.

$8.5 USD in 3 dias
(0 Comentários)
0.0