sbd-npm 1.2.65 → 1.2.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util.js +6 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.65",
3
+ "version": "1.2.67",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -714,10 +714,8 @@ const Util = {
714
714
  */
715
715
  init_table_skeleton: function (options) {
716
716
  if (options["head_cols"]) {
717
- let is_table_sort = 0;
718
- let is_tooltip = 0;
717
+ let is_table_sort = 0, is_tooltip = 0, _html = [];
719
718
  let head_length = options["head_cols"].length;
720
- let _html = [];
721
719
  if (options["alert"]) {
722
720
  _html.push('<div class="alert alert-info" role="alert">');
723
721
  _html.push(options["alert"]);
@@ -2395,19 +2393,18 @@ const Util = {
2395
2393
  * @returns {string}
2396
2394
  */
2397
2395
  year_price_rate: function (price, year_price) {
2398
- let cls = "";
2399
- let r_val = 0;
2396
+ let cls = "", rate_val = 0;
2400
2397
  if (price > 0 && year_price > 0) {
2401
2398
  if (price > year_price) {
2402
2399
  cls = "text-danger";
2403
- r_val = Math.round(((price - year_price) / year_price) * 10000) / 100;
2400
+ rate_val = Math.round(((price - year_price) / year_price) * 10000) / 100;
2404
2401
  } else if (price < year_price) {
2405
2402
  cls = "text-success";
2406
- r_val = Math.round(((year_price - price) / year_price) * 10000) / 100;
2407
- r_val = -r_val
2403
+ rate_val = Math.round(((year_price - price) / year_price) * 10000) / 100;
2404
+ rate_val = -rate_val
2408
2405
  }
2409
2406
  }
2410
- return "<b title='" + year_price + "' class='" + cls + "'>" + r_val + "%</b>";
2407
+ return "<b title='" + (year_price + " - " + price) + "' class='" + cls + "'>" + rate_val + "%</b>";
2411
2408
  },
2412
2409
 
2413
2410
  /**