@fast-china/utils 1.0.14 → 1.0.15
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.
- package/dist/index.global.js +25 -0
- package/dist/index.global.js.map +1 -1
- package/dist/index.global.min.js +5 -5
- package/dist/index.global.min.js.map +1 -1
- package/es/string/index.d.ts +4 -0
- package/es/string/index.mjs +26 -1
- package/es/string/index.mjs.map +1 -1
- package/lib/string/index.d.ts +4 -0
- package/lib/string/index.js +1 -1
- package/lib/string/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -13862,6 +13862,13 @@ var FastUtils = function(exports, vue) {
|
|
|
13862
13862
|
}
|
|
13863
13863
|
}
|
|
13864
13864
|
};
|
|
13865
|
+
let language;
|
|
13866
|
+
const languageMap = {
|
|
13867
|
+
zh: "zh-CN",
|
|
13868
|
+
en: "en-US",
|
|
13869
|
+
zh_CN: "zh-CN",
|
|
13870
|
+
zh_TW: "zh-TW"
|
|
13871
|
+
};
|
|
13865
13872
|
const stringUtil = {
|
|
13866
13873
|
/**
|
|
13867
13874
|
* 获取Url参数
|
|
@@ -13953,6 +13960,24 @@ var FastUtils = function(exports, vue) {
|
|
|
13953
13960
|
}
|
|
13954
13961
|
return uuid;
|
|
13955
13962
|
},
|
|
13963
|
+
/**
|
|
13964
|
+
* 使用程序运行的语言将Number转为特定格式的字符串
|
|
13965
|
+
*/
|
|
13966
|
+
toLocaleString(value, options) {
|
|
13967
|
+
if (value) {
|
|
13968
|
+
if (isNumber(value)) {
|
|
13969
|
+
if (typeof uni !== "undefined") {
|
|
13970
|
+
if (!language) {
|
|
13971
|
+
language = uni.getAppBaseInfo().language;
|
|
13972
|
+
}
|
|
13973
|
+
return value.toLocaleString(languageMap[language] || "zh-CN", options);
|
|
13974
|
+
} else {
|
|
13975
|
+
return value.toLocaleString(navigator.language || "zh-CN", options);
|
|
13976
|
+
}
|
|
13977
|
+
}
|
|
13978
|
+
}
|
|
13979
|
+
return value;
|
|
13980
|
+
},
|
|
13956
13981
|
/**
|
|
13957
13982
|
* 复制
|
|
13958
13983
|
*/
|