changeset 108617:429144ae3b54

calc-ext.el (math-group-float): Have the number of digits being grouped depend on the radix (Bug#6189).
author Jay Belanger <jay.p.belanger@gmail.com>
date Sat, 15 May 2010 21:18:52 -0500
parents 2ac105f2b2ac
children 2f98c61bd2c1
files lisp/ChangeLog lisp/calc/calc-ext.el
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat May 15 17:30:14 2010 -0700
+++ b/lisp/ChangeLog	Sat May 15 21:18:52 2010 -0500
@@ -1,3 +1,8 @@
+2010-05-16  Jay Belanger  <jay.p.belanger@gmail.com>
+
+	* calc/calc-ext.el (math-group-float):  Have the number of digits
+	being grouped depend on the radix (Bug#6189).
+
 2010-05-15  Ken Raeburn  <raeburn@raeburn.org>
 
 	* version.el (emacs-copyright, emacs-version): Don't define here,
--- a/lisp/calc/calc-ext.el	Sat May 15 17:30:14 2010 -0700
+++ b/lisp/calc/calc-ext.el	Sat May 15 21:18:52 2010 -0500
@@ -3469,7 +3469,8 @@
 
 (defun math-group-float (str)   ; [X X]
   (let* ((pt (or (string-match "[^0-9a-zA-Z]" str) (length str)))
-	 (g (if (integerp calc-group-digits) (math-abs calc-group-digits) 3))
+	 (g (if (integerp calc-group-digits) (math-abs calc-group-digits)
+              (if (memq calc-number-radix '(2 16)) 4 3)))
 	 (i pt))
     (if (and (integerp calc-group-digits) (< calc-group-digits 0))
 	(while (< (setq i (+ (1+ i) g)) (length str))