mysql remove excess tail after the decimal point 0

 First, give us a po fraught pit goods sent the wrong Bowen: https: //blog.csdn.net/lichangpeng1988/article/details/21955615

This blog is entirely the result of the author's own fabricated, the actual results are as follows, or 2.00 may be noted, is not the main spoken Fair 2

The following give us a correct reference Bowen,

https://blog.csdn.net/shayeyekai/article/details/17841433

# MySQL of the CAST () and the CONVERT () function is used to obtain the value of a type, and generates a value of another type. Both specific syntax is as follows:
the CAST (value AS type);
the CONVERT (value, type);

Next is my own test

Test 1: If the type does not convert to decimal char type, the following results

Test 2: If you do not add 0+, is completely not have any effect

Test 3: The correct presentation

The following is to convert the same test performed, it differs from the frame representation at


----------------
Disclaimer: This article is the original article CSDN bloggers "Howie_Yue", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/qq_34175893/article/details/79769611

Published 51 original articles · won praise 80 · views 930 000 +

Guess you like

Origin blog.csdn.net/xiyang_1990/article/details/103580226