Code review for previous commit.

See #771.
This commit is contained in:
Dimitri Fontaine 2018-03-27 14:55:31 +02:00
parent c6271506ab
commit cb9e01f4d9
2 changed files with 12 additions and 3 deletions

View File

@ -84,6 +84,14 @@ The provided transformation functions are:
In: 100.0d0
Out: "100.0"
- *hex-to-dec*
Converts a string containing an hexadecimal representation of a number
into its decimal representation::
In: "deadbeef"
Out: "3735928559"
- *set-to-enum-array*
Converts a string representing a MySQL SET into a PostgreSQL Array of

View File

@ -374,7 +374,8 @@
(null nil)
(string (base64:base64-string-to-string string))))
(defun hex-to-dec (string)
(etypecase hex
(defun hex-to-dec (hex-string)
(etypecase hex-string
(null nil)
(string (write-to-string (parse-integer hex :radix 16)))))
(integer hex-string)
(string (write-to-string (parse-integer hex-string :radix 16)))))