Decimal shaping
Sprintf function in PHP can format integers into floating-point format. For example, format parameter:% nf where n represents the number of digits after the decimal point. For example:

& lt? Server-side programming language (abbreviation of professional hypertext preprocessor)

$ num = 9.8

$res=sprintf("%.2f ",$ num);

//Output: 9.80

& gt