×ðÁú¿­Ê±¹ÙÍøµÇ¼

mysqlÖÐroundʲôÒâ˼

round º¯ÊýÓÃÓÚ½«Êý×ÖËÄÉáÎåÈëµ½Ö¸¶¨Î»Êý£ºÓï·¨£ºround(number, decimals)£»decimals ΪÕýֵʱ£¬ËÄÉáÎåÈëµ½Ö¸¶¨Ð¡ÊýλÊý£»decimals Ϊ¸ºÖµÊ±£¬ËÄÉáÎåÈëµ½Ö¸¶¨ÕûÊýλ֮ǰ£»decimals Ϊ 0 ʱ£¬ÉáÈëµ½×î¿¿½üµÄÕûÊý£»number »ò decimals Ϊ null ʱ£¬·µ»Ø null¡£

ROUND º¯Êý

ROUND º¯ÊýÓÃÓÚ½«Êý×ÖËÄÉáÎåÈëµ½Ö¸¶¨µÄλÊý¡£

Óï·¨£º

ROUND(number, decimals)

µÇ¼ºó¸´ÖÆ

ÆäÖУº

number£ºÒªÉáÈëµÄÊý×Ö¡£

decimals£ºÖ¸¶¨ËÄÉáÎåÈëµ½µÄСÊýλÊý¡£

Àý×Ó£º

ROUND(123.456, 2) = 123.46

ROUND(3.14159, 3) = 3.142

ROUND(-25.789, 0) = -26

×¢ÖØ£º

ÈôÊÇ decimals ΪÕýÖµ£¬ÔòËÄÉáÎåÈ뵽СÊýµãºóÖ¸¶¨Î»Êý¡£

ÈôÊÇ decimals Ϊ¸ºÖµ£¬ÔòËÄÉáÎåÈëµ½Ö¸¶¨Î»Êý֮ǰµÄÕûÊýλ¡£

ÈôÊÇ decimals Ϊ 0£¬ÔòÉáÈëµ½×î¿¿½üµÄÕûÊý¡£

ÈôÊÇ number Ϊ NULL »ò decimals Ϊ NULL£¬Ôò·µ»Ø NULL¡£

ÒÔÉϾÍÊÇmysqlÖÐroundʲôÒâ˼µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ