[GNC] Finance::Quote expected digits after -

Bruce Schuck bschuck at asgard-systems.com
Mon Sep 23 21:55:14 EDT 2024


On 9/23/24 22:58:31 +0100, Fred Tydeman wrote:

> On Mon, Sep 23, 2024 at 5:34?PM Scott Steimle<scoaste at gmail.com>
> wrote:

>> Looking at the JSON, I see this being returned, so indeed there is
>> an issue with the service response not being parsed well:
>> "div_yield":-nan

> 'nan' means Not A Number In this case, it would have come from 0 / 0

Scott and I took the conversation to the SourceForge finance-quote-user 
email list - 
https://sourceforge.net/p/finance-quote/mailman/message/58820313/

Unfortunately many of the F::Q modules, old and new, have minimal data 
validation. In this case the code was attempting to multiply "nan" by 
100 (the annual yield in the JSON is a decimal fraction and needs to be 
multiplied by 100 to convert to percentage). Seems some securities from 
YahooJSON with no dividends have a 0 (MXL for example) in the field, and 
others like SICP will have "nan".

Fixed in trial release 1.63_03 (CPAN: 
BPSCHUCK/Finance-Quote-1.63_03.tar.gz).

Bruce S.


More information about the gnucash-user mailing list