×ðÁú¿­Ê±

mysqlÖеÄroundº¯ÊýÊÇʲôº¯Êý

mysql ÖÐµÄ round º¯ÊýÓÃÓÚ¶ÔÊý×Ö¾ÙÐÐËÄÉáÎåÈë £¬Ó﷨Ϊ round(number, decimal_places) £¬ÆäÖÐ number ΪҪÉáÈëµÄÊý×Ö £¬decimal_places ΪÉáÈëºó±£´æµÄСÊýλÊý £¬Èç round(123.456, 2) ·µ»ØËÄÉáÎåÈ뵽СÊýµãºóÁ½Î»µÄÊý×Ö 123.46¡£

MySQL ÖÐµÄ ROUND º¯Êý

ROUND º¯ÊýÊÇÒ»¸öÓÃÓÚ¶ÔÊý×Ö¾ÙÐÐËÄÉáÎåÈëµÄº¯Êý¡£ËüÐèÒªÁ½¸ö²ÎÊý£º

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

СÊýλÊý£ºÉáÈëºó±£´æµÄСÊýλÊý¡£

Óï·¨£º

ROUND(number, decimal_places)

µÇ¼ºó¸´ÖÆ

·µ»ØÖµ£º

ROUND º¯Êý·µ»ØÉáÈëºóµÄÊý×Ö¡£

Ó÷¨£º

ROUND º¯Êý³£ÓÃÓÚ¶ÔÇ®±ÒÖµ»òÆäËûÐèÒªÉáÈëµÄÊý×Ö¾ÙÐÐÃûÌû¯¡£ÀýÈ磺

SELECT ROUND(123.456, 2);

µÇ¼ºó¸´ÖÆ

Õ⽫·µ»ØËÄÉáÎåÈ뵽СÊýµãºóÁ½Î»µÄÊý×Ö£º123.46¡£

ʾÀý£º

ϱíչʾÁ˲î±ðÊý×ÖºÍСÊýλÊýµÄ ROUND º¯ÊýЧ¹û£º

Êý×Ö Ð¡ÊýλÊý Ч¹û
123.456 0 123
123.456 1 123.5
123.456 2 123.46
123.456 3 123.456

×¢ÖØÊÂÏ

ÈôÊÇСÊýλÊýΪ¸ºÊý £¬ROUND º¯Êý½«ÉáÈëµ½ÕûÊýλ¡£

ÈôÊÇСÊýλÊýΪ 0 £¬ROUND º¯Êý½«ËÄÉáÎåÈëµ½×î¿¿½üµÄÕûÊý¡£

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

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

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

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

QR code
¡¾ÍøÕ¾µØͼ¡¿¡¾sitemap¡¿