main_value=13652.598
arr = main_value.toString().split(".");
var firstvalue=arr['0'].substring(1,-2);
var secoundtvalue=arr['1'].substring(1,-1);
预期的第一个值是2,预期的第二个值是5.
答案 0 :(得分:1)
你可以做这样的事情
Dim BaseSht As Worksheet
Dim InputArray() As String
Dim i As Integer, j As Integer, r As Integer, m As Integer, k As Integer
Set BaseSht = ThisWorkbook.Sheets("Base")
ReDim InputArray(1 To 798, 1 To 22)
LoopStart:
With BaseSht
For m = 1 To 866
If .Cells(m + 1, 23).Value = 6 Then GoTo Line1
Line1:
k = UBound(InputArray, 1) + 1
For j = 1 To 22
InputArray(k, j) = .Cells(m + 1, j).Value
Next j
Next m
End With
'GoTo LoopStart
答案 1 :(得分:0)
你可以这样做。
var main_value = 13652.598;
var arr = main_value.toString().split(".");
var firstvalue = arr[0].substring(arr[0].length - 1);
var lastvalue = arr[1].substring(0, 1);
console.log(firstvalue, lastvalue);
答案 2 :(得分:0)
var mainValue = 13652.598,
first = mainValue % 10 | 0,
second = mainValue % 1 * 10 | 0;
console.log(first, second);