Files
eiffel-org/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Getting-a-STRING-from-a-NUMERIC-object.wiki
eiffel-org 425ebed7d6 Merged 18.01 changes into trunk.
git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2030 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
2018-05-28 16:59:46 +00:00

15 lines
782 B
Plaintext

[[Property:uuid|B74D374E-895C-4F22-B95F-656BD78ECD03]]
[[Property:weight|1000]]
[[Property:title|Getting a STRING from a NUMERIC object]]
[[Property:link_title|NUMERIC to STRING]]
Every class has the <code>out</code> method that can be used to get a text version of the object. For a lot of class, this method return internal informations that are not really useful for the end user. But for every <code>NUMERIC</code> class, the <code>out</code> method return a text representation of the number that the <code>NUMERIC</code> object represents.
<code>
print_integer(a_integer:INTEGER)
-- Print the value of `a_integer'
do
print(a_integer.out + "%N")
end
</code>
Note that for more advance convertion, you can also used convertion class like <code>FORMAT_DOUBLE</code>.