plainheart commented on issue #17419:
URL: https://github.com/apache/echarts/issues/17419#issuecomment-1201216770

   Two ways to do this:
   
   1. Replace the comma with space
   
   ```js
   formatter: v => echarts.format.addCommas(v).replace(/,/g, ' ')
   ```
   
   2. Add spaces via a helper function
   
   ```js
   function addSpaces(val) {
     const parts = (val + '').split('.');
     return parts[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1 ') + 
(parts.length > 1 ? ('.' + parts[1]) : '');
   }
   ```
   
   ```js
   formatter: v => addSpaces(v)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to