(calc-convert-temperature): Ensure that units are on the result

even when the result is zero.
This commit is contained in:
Jay Belanger 2007-12-31 02:40:18 +00:00
parent a271e124f4
commit a34f800f02
2 changed files with 13 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2007-12-31 Jay Belanger <jay.p.belanger@gmail.com>
* calc/calc-units.el (calc-convert-temperature): Ensure that units
are on the result even when the result is zero.
2007-12-30 Michael Albinus <michael.albinus@gmx.de>
* net/dbus.el (dbus-name-owner-changed-handler): Make the function

View file

@ -491,9 +491,14 @@ If EXPR is nil, return nil."
(when (eq (car-safe unew) 'error)
(error "Bad format in units expression: %s" (nth 2 unew)))
(math-put-default-units unew)
(calc-enter-result 1 "cvtm" (math-simplify-units
(math-convert-temperature expr uold unew
uoldname))))))
(let ((ntemp (calc-normalize
(math-simplify-units
(math-convert-temperature expr uold unew
uoldname)))))
(if (Math-zerop ntemp)
(setq ntemp (list '* ntemp unew)))
(let ((calc-simplify-mode 'none))
(calc-enter-result 1 "cvtm" ntemp))))))
(defun calc-remove-units ()
(interactive)