Novice Novice - 1 month ago 19
MySQL Question

How to convert values into Thousands in the Backend

I have a text box with an extension of thousands.

In the text box the user enters only "7" for 7000 and "10" for 10000 and "75" for 75000. The values of 7000, 10000 has to be stored in our database. How can we do this?

As of Initial step, I have created a normal database connection to store values in the database. My databse will store only values in the format of 7,10,75 as user entered but not of multiplication*1000

But I would like to store it in the form of thousands. Could you let me know how to code this in the database?

Thanks

Raj Raj
Answer

Multiply it by 1000 while entering. eq

<?php
$number=intval($_POST["number"])*1000;
$sql="insert into database.table values($number)";
//query to database
?>