dozy 1.0.71 → 1.0.72

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.d.ts CHANGED
@@ -448,27 +448,30 @@ declare const shanghaiDateFormatter: Intl.DateTimeFormat;
448
448
  */
449
449
  declare function $formatDate(dateInput: string | number | Date): string;
450
450
  /**
451
- * 格式化数值为字符串,先放大再保留指定小数位数。
451
+ * 格式化数值为字符串,先放大再保留指定小数位数,并添加千分位分隔符。
452
452
  *
453
453
  * 行为说明:
454
454
  * - 先将数值乘以 10^bits 进行放大。
455
455
  * - 然后使用 `toFixed(bits)` 保留指定位数的小数。
456
+ * - 最后通过 `$formatWithCommas` 添加千分位逗号分隔符。
456
457
  * - 当输入不是有效数字时返回 `'-'`。
457
458
  *
458
459
  * @param points 要格式化的数值。
459
460
  * @param bits 放大倍数的指数,同时也是小数位数,默认为 `2`。
460
- * @returns 返回格式化后的字符串;输入无效时返回 `'-'`。
461
+ * @returns 返回格式化后的字符串(含千分位);输入无效时返回 `'-'`。
461
462
  *
462
463
  * @example
463
- * $formatPoints(1.23, 2) // 返回 "123.00"
464
- * $formatPoints(0.5, 3) // 返回 "500.000"
464
+ * $formatPoints(1.23, 2) // 返回 "123.00"
465
+ * $formatPoints(12.34, 2) // 返回 "1,234.00"
466
+ * $formatPoints(0.5, 3) // 返回 "500.000"
465
467
  */
466
468
  declare function $formatPoints(points: number, bits?: number): string;
467
469
  /**
468
- * 格式化数值为带符号和颜色的显示元组。
470
+ * 格式化数值为带符号和颜色的显示元组,并添加千分位分隔符。
469
471
  *
470
472
  * 行为说明:
471
473
  * - 先将数值乘以 10^bits 进行放大,然后使用 `toFixed(bits)` 格式化。
474
+ * - 通过 `$formatWithCommas` 添加千分位逗号分隔符。
472
475
  * - 根据数值正负自动添加符号前缀并分配对应颜色。
473
476
  * - 正数:前缀 `'+'`,颜色 `'#0a0'`(绿色)。
474
477
  * - 负数:前缀 `'-'`,颜色 `'#a00'`(红色)。
@@ -477,12 +480,13 @@ declare function $formatPoints(points: number, bits?: number): string;
477
480
  *
478
481
  * @param points 要格式化的数值。
479
482
  * @param bits 放大倍数的指数,同时也是小数位数,默认为 `2`。
480
- * @returns 返回包含显示文本和颜色的元组 `[display, color]`。
483
+ * @returns 返回包含显示文本(含千分位)和颜色的元组 `[display, color]`。
481
484
  *
482
485
  * @example
483
- * $formatPointsWithChange(1.23, 2) // 返回 ["+123.00", "#0a0"]
484
- * $formatPointsWithChange(-0.5, 2) // 返回 ["-50.00", "#a00"]
485
- * $formatPointsWithChange(0, 2) // 返回 ["0.00", "#333"]
486
+ * $formatPointsWithChange(1.23, 2) // 返回 ["+123.00", "#0a0"]
487
+ * $formatPointsWithChange(12.34, 2) // 返回 ["+1,234.00", "#0a0"]
488
+ * $formatPointsWithChange(-0.5, 2) // 返回 ["-50.00", "#a00"]
489
+ * $formatPointsWithChange(0, 2) // 返回 ["0.00", "#333"]
486
490
  */
487
491
  declare function $formatPointsWithChange(points: number, bits?: number): [display: string, color: string];
488
492
  /**
@@ -973,6 +977,6 @@ declare function toRgbString(input: string | Color | any): string | undefined;
973
977
  */
974
978
  declare function toHslString(input: string | Color | any): string | undefined;
975
979
 
976
- declare const DOZY = "1.0.71";
980
+ declare const DOZY = "1.0.72";
977
981
 
978
982
  export { $Headers, $Request, $Response, $URL, $URLSearchParams, $arrayFrom, $arrayIsArray, $assign, $backgroundColor, $borderColor, $capitalize, $checkValidEmailWithUnicode, $clamp, $clearInterval, $clearTimeout, $clone, $compressImage, $compressImageBase64, $compressImageDefaultOptions, $copy, $crypto, $date, $decodeBase64ToBinary, $decodeBase64ToUnicode, $deepClone, $defineProperty, $document, $encodeUnicodeToBase64, $entries, $escapeHTML, $fallbackCopy, $fetch, $fileToBase64, $formatDate, $formatPoints, $formatPointsWithChange, $formatWithCommas, $freeze, $genSSF, $getFileType, $getHue, $getTimeString, $hasKey, $if, $inRange, $inRange2, $inferMimeTypeFormPureBase64, $is, $isObject, $isPlainClass, $isValidEmailWithUnicode, $isValidOrBriefURL, $jsonParse, $jsonStringify, $keys, $lastIndex, $lindex, $loadOpt, $location, $log, $lplus, $magic, $math, $now, $numberIsFinite, $numberIsNaN, $oc, $open, $parseParams, $promise, $pureText, $purifyBase64, $randomByte, $replaceHolesWithUndefined, $rmvSlash, $rsValue, $rsetValue, $rvalue, $s, $sc, $setInterval, $setRange, $setTimeout, $stringFromCharCode, $stringFromCodePoint, $stringToRange, $strings, $toDataUrlFromBase64, $validName, $values, $window, type Any, type Atoa, type Coord, type Coord3, DOZY, type DozyConfig, type DozyConfigItem, type FileType, Gens, type Hel, type IOpt, type Items, type Null, type Nullable, RainbowGen, type ScaleComputer, type ScaleIniter, StringObfuscator, type UNumber, __GensDirectives, _res, boxShadow, dozy, enableScaler, err403, errArg, errCode, errContent, errMsg, errNotLoggedIn, errToString, getBrightness, getColorMap, isNowAroundUtcHour, isNull, isValidColor, maybeString, registerCustomColor, s, shanghaiDateFormatter, smallChance, smartParse, smartString, standardIniter, textShadow, toHexString, toHslString, toRgbString, toRgbaArray, web$enableHttpsRedirect, web$enableProdProtector, web$encodeURI, web$pathStartData, web$redirectToDomain, web$setPathTarget, xtrim };