Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Help Formatting Numbers in PHP

dwapo

Recruit
Basic Member
Messages
1
Reaction score
0
Points
16
Mga Sir(s);

Pahelp naman po ako. nag self study kasi ng basic web development. Paano po magkaroon ng decimal point and comma ang mga numbers ko especially sa amount ng item.

Maraming salamat po.
 
Re: pHP

Try to use the number_format() function TS. The syntax will be:

number_format(number,decimals,decimalpoint,separator)

number - number na ifoformat mo.
decimal - kung ilang decimal place ang gusto mo.
decimalpoint - just use ".".
separator - ito yung magsesaparate ng thousand value mo.

Example para mas madali maintindihan. The number will be 189671, tapos ang gusto mong output is 1,896.71. You use the code:

number_format(189671,2,".",",")

Make sure na naka "" yung dot (.) tsaka comma (,) mo TS kasi that is formatted as string.
 
Back
Top Bottom