"use strict";
require("../common/vendor.js");
require("../request/http.js");
function getRateStr(r) {
  if (!r)
    return;
  r = String(r);
  if (r.indexOf("-") > -1) {
    r = r.substr(1, r.length - 1);
    return (parseFloat(r) * 100).toFixed(2);
  } else {
    if (parseFloat(r) == 0) {
      return 0;
    } else
      return (parseFloat(r) * 100).toFixed(2);
  }
}
function getLocaleTime(time) {
  let date = new Date(time);
  let year = date.getFullYear();
  let month = date.getMonth() + 1;
  let day = date.getDate();
  let hour = date.getHours();
  let minute = date.getMinutes();
  return year + "-" + (month < 10 ? "0" + month : month) + "-" + (day < 10 ? "0" + day : day) + " " + (hour < 10 ? "0" + hour : hour) + ":" + (minute < 10 ? "0" + minute : minute);
}
function getRateUpOrDown(r) {
  if (!r)
    return;
  return String(r).indexOf("-") > -1;
}
exports.getLocaleTime = getLocaleTime;
exports.getRateStr = getRateStr;
exports.getRateUpOrDown = getRateUpOrDown;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/util.js.map
