zoukankan      html  css  js  c++  java
  • 取开始日期和字符串

    //Script here
    //result = result.replace("var allSubject = ","");
    //var cc = result.indexOf(';');
    //var listData = result.substr(0,cc);
    var allSubject = null;
    var cc = result.indexOf(';');
    var result = result.substr(0,cc+1);
    var subname_list = [];
    eval(result);
    //var listData = JSON.stringify(allSubject);

    var tmp = [];
    for (var i in allSubject){
    var row = allSubject[i];
    var hotFundYield = row['hotFundYield'];
    var hotFundCode = null;
    var hotFundSname = null;
    var hotFundUnitNetChngPctTyear = null;
    if (hotFundYield)
    {
    hotFundCode=hotFundYield.fundCode;
    hotFundSname=hotFundYield.fundSName;
    hotFundUnitNetChngPctTyear=hotFundYield.unit_net_chng_pct_tyear;
    }else{
    }
    tmp.push({
    'subName':row['subName'],
    'unitNetChngPct1Week':row['unit_net_chng_pct_1_week'],
    'unitNetChngPct1Mon':row['unit_net_chng_pct_1_mon'],
    'unitNetChngPctTYear':row['unit_net_chng_pct_tyear'],
    'unitNetChngPct1Year':row['unit_net_chng_pct_1_year'],
    'hotFundCode':hotFundCode,
    'hotFundSname':hotFundSname,
    'hotFundUnitNetChngPctTYear':hotFundUnitNetChngPctTyear
    });
    };
    tmp.sort(function(a,b){
    return b.unitNetChngPct1Week-a.unitNetChngPct1Week;
    });
    var subname_list = [];
    for (var i in tmp){
    subname_list.push(tmp[i].subName);
    if (subname_list.length>=3){
    break;
    }
    }
    subname_list = subname_list.join(",");
    subname_list=','+subname_list+',';

    var listData = JSON.stringify(tmp);

  • 相关阅读:
    poj 1466 Girls and Boys
    poj 1486 Sorting Slides
    poj 2112 Optimal Milking
    poj 1274 The Perfect Stall
    SHoj 420 购买装备
    poj 2987 Firing
    SHoj A序列
    FOJ Problem 2271 X
    XidianOJ 1028 数字工程
    XidianOJ 1030 三数和
  • 原文地址:https://www.cnblogs.com/gina11/p/13952520.html
Copyright © 2011-2022 走看看