Truncate numbers in a Mysql column

Asked

Viewed 300 times

1

I want to leave all numbers that are entered in my bank with a maximum of 1 decimal place after the comma without rounding Ex: 3.2567 = 3.2 I want to know if I can truncate all the column of the bank ( I tried but could not), using: Select truncate (column,1).

  • 2

    "I tried but couldn’t" is a little vague. The syntax is TRUNCATE( coluna, casas) even (at least in version 5.5 was already present). What problem did you have? As described, your problem cannot be reproduced.

  • 1

    What type of column?

  • You want to update the column?

  • Is that what you want? http://answall.com/questions/37947/valor-decimal-mysql

  • I tried truncate (column, 1). This column is INT

  • 1

    Truncate (column, 1) in Integer column?

  • 1

    I did so and it worked: round (sum (column/1000),1) the total. The numbers are only ima casa after the comma. I don’t know if it was too much of a scam but it worked.

  • @Leo Caracciolo yes whole.

  • It sounds strange to me integer with decimal, INT or INTEGER A full-sized integer

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.