Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Section B.6. BigDecimal

B.6. BigDecimal

B.6.1. active_support/core_ext/big_decimal/conversions

to_yaml

Emits the number without any scientific notation and without losing precision. Note that reconstituting YAML floats to native floats may lose precision.

>> bd = BigDecimal.new("84394878749783498749834734987.839723497347")
=> #<BigDecimal:269fabc,'0.8439487874 9783498749 8347349878 3972349734
7E29',44(48)>
>> bd.to_yaml
=> "--- 84394878749783498749834734987.839723497347\n"


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial