简体   繁体   中英

styling with numbers for number formats using css

when using the number_format is it possible to customize the font or size found sites that say you cant but just want to double check?

$em = mysqli_query($con, "SELECT * FROM `users`"); 
if(mysqli_num_rows($em) > 0){     
   while($row = mysqli_fetch_array($em)){
      $amount = $row['amount'];
      echo number_format($amount, 0);
   }
}

just use a CSS class for it or use inline style like this, here is the example:

  while($row = mysqli_fetch_array($em)){

        $amount = $row['amount'];
    
        $formated_number = number_format($amount, 0);

        echo '<span style="color:#000000;font-weight:bold;font-size:24px;">'.$formated_number.'</span>'
         }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM