• Resolved travelnval

    (@travelnval)


    Absolutely great plugin.

    I am trying to add this to a table to do calculations form the price. Making my own table of stock cost and then using Stock Quote to get the current price. However, when I return the %price% it is telling me that it is not an number. Likely because it is returning the “up”/”down” arrow and other things as well? Would love if there could just be a pure price as a field template so can use it for calculations.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Aleksandar Uro?evi?

    (@urkekg)

    Hello @travelnval,

    Thank you for using our plugin and for this interesting feature request.

    I added option to print out shortcode value without wrapping it to SPAN element. Would you like to get updated version from plugin’s GitHub repo https://github.com/urosevic/stock-quote and test it.

    Just to note, use shortcode like this to get raw price amount for whatever you wish to use:

    [stock_quote symbol="MSFT" raw="1" template="%raw_price%"]

    If you use this in template PHP files, you could use something like this:

    if (class_exists('Wpau_Stock_Quote')) {
    	$Wpau_Stock_Quote = new Wpau_Stock_Quote();
    	$price = $Wpau_Stock_Quote->shortcode( array( 'symbol' => 'EURRSD=X', 'raw' => '1', 'template' => '%raw_price%') );
    	// Do with $price whatever you wish
    }

    Kind regards,
    Aleksandar

    • This reply was modified 6 years, 9 months ago by Aleksandar Uro?evi?. Reason: reformat long code snippet
    Thread Starter travelnval

    (@travelnval)

    I made the edits and it appears to show a number, for example, using AAPL the raw price returned 172.4300 without anything else. So looks like a number. However, the table calculator I am using still shows it as an Error in the Calculation
    “!ERROR! C2 (the cell) does not contain a number or expression”

    Just wondering, for the raw data, is the plugin returning the number as a string or text vs as a number?

    Not my area of expertise, just thinking. Otherwise, perhaps its an error with the way the table is doing the calculations, but I think we are close!

    Thanks

    Thread Starter travelnval

    (@travelnval)

    Actually, disregard, in my table I needed to ensure I evaluated the short code first before applying the formula. So this works great now! 100%

    Appreciate the quick reply and the update. Thanks

    Plugin Author Aleksandar Uro?evi?

    (@urkekg)

    Hi @travelnval,

    Thank you for confirmation.
    If you enjoying this Stock Quote plugin, please feel free to review it at https://www.ads-software.com/support/plugin/stock-quote/reviews/

    Kind regards,
    Aleksandar

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Return Price as a Number’ is closed to new replies.