Plugin Directory

Changeset 1114920


Ignore:
Timestamp:
03/17/2015 11:25:48 PM (11 years ago)
Author:
Relevad
Message:

Changed to rounding 3 decimal places instead of 2. Fixed bug with stock ticker, and added mention in the readme that html pre-defined colors are not supported

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • custom-stock-ticker/trunk/readme.txt

    r1111504 r1114920  
    2525 * Custom stocks for specific categories
    2626 * Preview of Stock Ticker after saving on settings page
     27 
     28Depricated support for pre-defined html colors:
     29 * Color strings such as blue, yellow, limegreen could be used in old version of this plugin. These are no longer supported and may be lost upon saving settings.
    2730
    2831Requirements:
  • custom-stock-ticker/trunk/stock_ticker_admin.php

    r1114248 r1114920  
    114114        stock_ticker_create_db_table();
    115115        $values = array( //NOTE: the rest should all be the defaults
     116                        'id'             => 1, //explicitly set this or else mysql configs where the default is not 1 will be broken
    116117                        'name'           => 'Default Settings',
    117118                        'advanced_style' => 'margin: auto;'
  • custom-stock-ticker/trunk/stock_ticker_display.php

    r1110775 r1114920  
    309309        //index 2 represents the last value of the stock
    310310        if($display_data[2]==1){
    311                 $data_item = round($stock_data['last_val'], 2);
     311                $data_item = round($stock_data['last_val'], 3); //yahoo gives 3 decimal places precision
    312312                $output .= "<div class='stock_ticker_element {$text_color}'>{$data_item}</div><!-- \n -->";               
    313313        }
    314314        //index 3 represents the value of the change
    315315        if($display_data[3]==1){
    316                 $data_item = round((float)$stock_data['change_val'], 2);
     316                $data_item = round((float)$stock_data['change_val'], 3);
    317317                if ($data_item == 0) { $data_item = '0.00'; } //give it 2 decimal places
    318318
     
    324324                $data_item = str_replace('%', '', $stock_data['change_percent']);
    325325                if ($data_item == '0') { $data_item = '0.00';  } //give it 2 decimal places
    326                 else                   { round((float)$data_item, 2); } //looks like this give it a + sign so that we don't need $text_plus
     326                else                   { round((float)$data_item, 3); } //looks like this give it a + sign so that we don't need $text_plus
    327327
    328328                $output .= "<div class='stock_ticker_element {$text_color}'>{$data_item}%</div><!-- \n -->";
  • custom-stock-widget/trunk/readme.txt

    r1111504 r1114920  
    2525 * Custom stocks for specific categories
    2626 * Preview of custom stock widget after saving on settings page
     27
     28Depricated support for pre-defined html colors:
     29 * Color strings such as blue, yellow, limegreen could be used in old version of this plugin. These are no longer supported and may be lost upon saving settings.
    2730
    2831Requirements:
  • custom-stock-widget/trunk/stock_widget_display.php

    r1114365 r1114920  
    254254function stock_widget_create_row($idx, $stock_data, $sw_settings) {
    255255    if(empty($stock_data['last_val'])) {
    256         return "<!-- Last Value did not exist, stock error -->";
     256        return "<!-- Last Value did not exist, stock error ({$stock_data['stock_sym']})-->";
    257257    }
    258258    $output = "";
     
    298298    if ($display_options[2] == 1) {
    299299        $data_item = $stock_data['last_val'];
    300         $data_item = round($data_item, 2);
     300        $data_item = round($data_item, 3); //yahoo gives 3 decimal places precision
    301301        $output   .= "<div class='stock_widget_element'>{$data_item}</div>{$vertical_line}<!-- \n -->";
    302302    }
     
    305305    //NOTE: this exists outside of sections because the color changing effect applies to both field 3 and 4
    306306    $data_item = $stock_data['change_val'];
    307     $data_item = round($data_item, 2);
     307    $data_item = round($data_item, 3);
    308308    if ($data_item > 0) {
    309309        $changer   = "sw_green";
     
    340340        $data_item = $stock_data['change_percent'];
    341341        $data_item = str_replace('%', '', $data_item);
    342         $data_item = round($data_item, 2);
     342        $data_item = round($data_item, 3);
    343343       
    344344        if ($data_item > 0) {         
Note: See TracChangeset for help on using the changeset viewer.