]> git.eshelyaron.com Git - emacs.git/commitdiff
(calc-time, calc-date-notation, math-this-year, math-parse-date)
authorJay Belanger <jay.p.belanger@gmail.com>
Mon, 2 May 2005 19:42:52 +0000 (19:42 +0000)
committerJay Belanger <jay.p.belanger@gmail.com>
Mon, 2 May 2005 19:42:52 +0000 (19:42 +0000)
(math-parse-standard-date, calcFunc-tzone): Replace string-to-int by
string-to-number.

lisp/calc/calc-forms.el

index 4870891231a8228c3bf71e1c3f77fbaeb9bed53d..10e4793c7a516d51e4d1a5713178a63da2b5583e 100644 (file)
@@ -39,9 +39,9 @@
      (calc-enter-result 0 "time"
                        (list 'mod
                              (list 'hms
-                                   (string-to-int (substring time 11 13))
-                                   (string-to-int (substring time 14 16))
-                                   (string-to-int (substring time 17 19)))
+                                   (string-to-number (substring time 11 13))
+                                   (string-to-number (substring time 14 16))
+                                   (string-to-number (substring time 17 19)))
                              (list 'hms 24 0 0))))))
 
 (defun calc-to-hms (arg)
@@ -80,7 +80,7 @@
    (if (equal fmt "")
        (setq fmt "1"))
    (if (string-match "\\` *[0-9] *\\'" fmt)
-       (setq fmt (nth (string-to-int fmt) calc-standard-date-formats)))
+       (setq fmt (nth (string-to-number fmt) calc-standard-date-formats)))
    (or (string-match "[a-zA-Z]" fmt)
        (error "Bad date format specifier"))
    (and arg
 
 
 (defun math-this-year ()
-  (string-to-int (substring (current-time-string) -4)))
+  (string-to-number (substring (current-time-string) -4)))
 
 (defun math-leap-year-p (year)
   (if (Math-lessp year 1752)
          (if (or (string-match "\\([0-9][0-9]?\\):\\([0-9][0-9]?\\)\\(:\\([0-9][0-9]?\\(\\.[0-9]+\\)?\\)\\)? *\\([ap]m?\\|[ap]\\. *m\\.\\|noon\\|n\\>\\|midnight\\|mid\\>\\|m\\>\\)?" math-pd-str)
                  (string-match "\\([0-9][0-9]?\\)\\(\\)\\(\\(\\(\\)\\)\\) *\\([ap]m?\\|[ap]\\. *m\\.\\|noon\\|n\\>\\|midnight\\|mid\\>\\|m\\>\\)" math-pd-str))
              (let ((ampm (math-match-substring math-pd-str 6)))
-               (setq hour (string-to-int (math-match-substring math-pd-str 1))
+               (setq hour (string-to-number (math-match-substring math-pd-str 1))
                      minute (math-match-substring math-pd-str 2)
                      second (math-match-substring math-pd-str 4)
                      math-pd-str (concat (substring math-pd-str 0 (match-beginning 0))
                                  (substring math-pd-str (match-end 0))))
                (if (equal minute "")
                    (setq minute 0)
-                 (setq minute (string-to-int minute)))
+                 (setq minute (string-to-number minute)))
                (if (equal second "")
                    (setq second 0)
                  (setq second (math-read-number second)))
          (setq temp 0)
          (while (string-match "[0-9]+" math-pd-str temp)
            (and c (throw 'syntax "Too many numbers in date"))
-           (setq c (string-to-int (math-match-substring math-pd-str 0)))
+           (setq c (string-to-number (math-match-substring math-pd-str 0)))
            (or b (setq b c c nil))
            (or a (setq a b b nil))
            (setq temp (match-end 0)))
                                  (string-match "\\` *[0-9][0-9][0-9]" math-pd-str)
                                (string-match "\\` *[0-9][0-9]" math-pd-str))
                            (string-match "\\` *[0-9]+" math-pd-str)))
-                    (and (setq num (string-to-int
+                    (and (setq num (string-to-number
                                     (math-match-substring math-pd-str 0))
                                math-pd-str (substring math-pd-str (match-end 0)))
                          nil))
              (setq p (cdr p))))
          (if (looking-at "\\([-+][0-9]?[0-9]\\)\\([0-9][0-9]\\)?\\(\\'\\|[^0-9]\\)")
              (setq offset (math-add
-                           (string-to-int (buffer-substring
+                           (string-to-number (buffer-substring
                                            (match-beginning 1)
                                            (match-end 1)))
                            (if (match-beginning 2)
-                               (math-div (string-to-int (buffer-substring
-                                                         (match-beginning 2)
-                                                         (match-end 2)))
+                               (math-div (string-to-number (buffer-substring
+                                                             (match-beginning 2)
+                                                             (match-end 2)))
                                          60)
                              0)))))
        (if p