更改项目模块名称,整合b站爬虫

This commit is contained in:
userA
2023-08-31 01:36:20 +08:00
parent 3334e2ec8f
commit c1010a5fb1
277 changed files with 150 additions and 98 deletions

View File

@@ -0,0 +1,38 @@
package org.example.util;
/**
* @author Genius
* @date 2023/07/19 02:17
**/
/**
* 中文转化工具
*/
public class ChineseConvertUtil {
/**
* 中文数量单位转Int
* @param str 中文字符串 如“350.1万”
* @return
*/
public static int cnNumericUnitsToInt(String str){
String[] parts = str.split("(?<=\\d\\.\\d)(?=\\D)");
if(parts.length==2){
float num = Float.parseFloat(parts[0]);
switch (parts[1]){
case "亿":
return (int)num*100000;
case "":
return (int)num*10000;
case "":
return (int)num*1000;
case "":
return (int)num*100;
case "":
return (int)num;
}
}
return Integer.parseInt(str);
}
}