Changeset 1114920
- Timestamp:
- 03/17/2015 11:25:48 PM (11 years ago)
- Files:
-
- 5 edited
-
custom-stock-ticker/trunk/readme.txt (modified) (1 diff)
-
custom-stock-ticker/trunk/stock_ticker_admin.php (modified) (1 diff)
-
custom-stock-ticker/trunk/stock_ticker_display.php (modified) (2 diffs)
-
custom-stock-widget/trunk/readme.txt (modified) (1 diff)
-
custom-stock-widget/trunk/stock_widget_display.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-stock-ticker/trunk/readme.txt
r1111504 r1114920 25 25 * Custom stocks for specific categories 26 26 * Preview of Stock Ticker after saving on settings page 27 28 Depricated 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. 27 30 28 31 Requirements: -
custom-stock-ticker/trunk/stock_ticker_admin.php
r1114248 r1114920 114 114 stock_ticker_create_db_table(); 115 115 $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 116 117 'name' => 'Default Settings', 117 118 'advanced_style' => 'margin: auto;' -
custom-stock-ticker/trunk/stock_ticker_display.php
r1110775 r1114920 309 309 //index 2 represents the last value of the stock 310 310 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 312 312 $output .= "<div class='stock_ticker_element {$text_color}'>{$data_item}</div><!-- \n -->"; 313 313 } 314 314 //index 3 represents the value of the change 315 315 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); 317 317 if ($data_item == 0) { $data_item = '0.00'; } //give it 2 decimal places 318 318 … … 324 324 $data_item = str_replace('%', '', $stock_data['change_percent']); 325 325 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_plus326 else { round((float)$data_item, 3); } //looks like this give it a + sign so that we don't need $text_plus 327 327 328 328 $output .= "<div class='stock_ticker_element {$text_color}'>{$data_item}%</div><!-- \n -->"; -
custom-stock-widget/trunk/readme.txt
r1111504 r1114920 25 25 * Custom stocks for specific categories 26 26 * Preview of custom stock widget after saving on settings page 27 28 Depricated 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. 27 30 28 31 Requirements: -
custom-stock-widget/trunk/stock_widget_display.php
r1114365 r1114920 254 254 function stock_widget_create_row($idx, $stock_data, $sw_settings) { 255 255 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']})-->"; 257 257 } 258 258 $output = ""; … … 298 298 if ($display_options[2] == 1) { 299 299 $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 301 301 $output .= "<div class='stock_widget_element'>{$data_item}</div>{$vertical_line}<!-- \n -->"; 302 302 } … … 305 305 //NOTE: this exists outside of sections because the color changing effect applies to both field 3 and 4 306 306 $data_item = $stock_data['change_val']; 307 $data_item = round($data_item, 2);307 $data_item = round($data_item, 3); 308 308 if ($data_item > 0) { 309 309 $changer = "sw_green"; … … 340 340 $data_item = $stock_data['change_percent']; 341 341 $data_item = str_replace('%', '', $data_item); 342 $data_item = round($data_item, 2);342 $data_item = round($data_item, 3); 343 343 344 344 if ($data_item > 0) {
Note: See TracChangeset
for help on using the changeset viewer.