小数比较大小需要把小数点对齐- @echo off
- setlocal enabledelayedexpansion
- (
- for /f "tokens=1-12" %%a in (bt_k.txt) do (
- call :Cpr %%c %%i
- if errorlevel 1 (echo;%%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l)
- )
- )>超领祥细.txt
- endlocal
- pause
- exit
-
- :Cpr
- setlocal
- set n1=%1
- set n2=%2
- set x1=%n1:.=%
- set x2=%n2:.=%
- if %x1%==%n1% (set n1=%n1%.0)
- if %x2%==%n2% (set n2=%n2%.0)
- set sz=0000000000000000
- for %%z in (1 2) do (
- for /f "delims=. tokens=1,2" %%x in ("!n%%z!") do (set/a z%%z=%%x,x%%z=%%y)
- set str=!z%%z!fedcba9876543210&set/a len=0x!str:~15,1!
- for /f %%w in ("!len!") do (set z%%z=!sz:~0,-%%w!!z%%z!)
- set str=!x%%z!fedcba9876543210&set/a len=0x!str:~15,1!
- for /f %%w in ("!len!") do (set x%%z=!x%%z!!sz:~0,-%%w!)
- )
- if "!z1!.!x1!" gtr "!z2!.!x2!" (endlocal & exit /b 1)
- endlocal
- exit /b 0
复制代码
|