0

How do i format my Query result so it has thousand seperator and only to 2 decimal places

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Daily Sales</title>

<link rel="stylesheet" href="../styles/login.css" media="all" />

</head>

<body class="normal">

<?php

  include("../includes/x3connect.php");

?>

<?php

$sql="SELECT SUM (CASE WHEN FFP.BPARTNER.CUR_0='GBP' THEN (FFP.SORDERQ.YORIQTY_0 * FFP.SORDERP.GROPRI_0) ELSE ((FFP.SORDERQ.YORIQTY_0 * FFP.SORDERP.GROPRI_0) * FFP.SORDER.CHGRAT_0) AS MONEY END) FROM FFP.SORDER INNER JOIN FFP.BPARTNER ON FFP.SORDER.BPCORD_0 = FFP.BPARTNER.BPRNUM_0 INNER JOIN FFP.SORDERP ON FFP.SORDER.SOHNUM_0 = FFP.SORDERP.SOHNUM_0 INNER JOIN FFP.SORDERQ ON FFP.SORDER.SOHNUM_0 = FFP.SORDERQ.SOHNUM_0 WHERE FFP.SORDER.YFPSODAT_0=DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0) and FFP.SORDER.SOHTYP_0!='SO6' and FFP.SORDER.YFPSOSO_0=2 and FFP.BPARTNER.CUR_0='GBP'";

$stmt=sqlsrv_query($conn, $sql);

if($stmt==false){
     echo 'Error to retrieve info ';
     die( print_r( sqlsrv_errors(), true));
}

$row=sqlsrv_fetch_array($stmt);
     echo 'The orders booked today totals : '.$row[0];

?>

</body>
</html>
2
Contributors
1
Reply
13
Views
1 Month
Discussion Span
Last Post by rproffitt
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.