Re: How to use NumberFormat to set maximum number of integer digit

125 views
Skip to first unread message

Joseph Lust

unread,
Jun 30, 2012, 2:08:29 PM6/30/12
to google-we...@googlegroups.com
that means format a 1234.567 will get 234.58. 

Why would you ever want to do that? Now you users don't know if you are displaying 234 or 1234 of 1000234. Your trouble might be coming from this unusual formatting you are attempting. Most number formatting functions won't do this because it does not make sense. They focus on truncation and rounding of the decimals which simply reduce the LSB's, not the MSB's.

If you must do this, just write your own function to truncate the higher magnitude values.


Sincerely,
Joseph 

Bakul

unread,
Jun 30, 2012, 9:56:30 PM6/30/12
to google-we...@googlegroups.com
Simply split it by dot. Take last 3 chars of first string, use formatting for second. And join again by dot

-Bakul

Reply all
Reply to author
Forward
0 new messages