Coba buat fungsi utk cek titik atau koma (pemisah decimal) saat akan menyimpan
data tersebut ke database, jadi tidak masalah apa regional settingnya, saya
coba kasih contohnya sperti code dibawah, mudah2an bisa membantu silahkan
sesuaikan dengan kebutuhan anda :
Salam,
Agus Rpea
===============================================
Dim i As Integer
Dim strMoisture As String
Dim dblMoisture As Double
Dim dblPuluhan As Double
Dim dblSatuan As Double
Dim intTitik As Integer
Dim intKoma As Integer
Dim intPOS As Integer
Dim FaktorKali As Double
strMoisture = txtMoisture.Text
intTitik = 0
intKoma = 0
intPOS = 0
intTitik = InStr(1, strMoisture, ".", vbTextCompare)
intKoma = InStr(1, strMoisture, ",", vbTextCompare)
If intTitik <> 0 Then
intPOS = intTitik
ElseIf intKoma <> 0 Then
intPOS = intKoma
End If
If intPOS <> 0 Then
dblPuluhan = CDbl(Left(strMoisture, intPOS - 1))
dblSatuan = CDbl(Right(strMoisture, Len(strMoisture) - intPOS))
If Len(Right(strMoisture, Len(strMoisture) - intPOS)) = 1 Then
FaktorKali = 0.1
ElseIf Len(Right(strMoisture, Len(strMoisture) - intPOS)) = 2 Then
FaktorKali = 0.01
ElseIf Len(Right(strMoisture, Len(strMoisture) - intPOS)) = 3 Then
FaktorKali = 0.001
ElseIf Len(Right(strMoisture, Len(strMoisture) - intPOS)) = 4 Then
FaktorKali = 0.0001
ElseIf Len(Right(strMoisture, Len(strMoisture) - intPOS)) = 5 Then
FaktorKali = 0.00001
End If
dblMoisture = dblPuluhan + (FaktorKali * dblSatuan)
Else
dblMoisture = CDbl(strMoisture)
End If
===============================================
djayanti wagnah <[EMAIL PROTECTED]> wrote:
hai...
pada setting field di tabel pada sql server type data decima dgn precesion 36
dan scale 2
pada saat input value dengan titik
salam
dj
----- Original Message ----
From: antoni toni <[EMAIL PROTECTED]>
To: [email protected]
Sent: Friday, February 23, 2007 2:02:22 PM
Subject: [indoprog-vb] Simpan Nilai Desimal (koma) di SQL Server 2000
Hi..teman-teman.
Boleh minta bantuannya gak ??
Gimana cara Simpan nilai yang ada desimal (koma) ke
SQL Server 2000 ? soalnya q sdh pake type data apa
saja tp msh kagak bisa. dan pernah q ubah setting
Regional (Ingriss) dan bisa. tapi koq di Regional
Indoneia gak bisa yach ???
Thank's before,
Antoni
____________ _________ _________ _________ _________ _________ _
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase. yahoo.com/ promo-generic- 14795097
Send instant messages to your online friends http://uk.messenger.yahoo.com
[Non-text portions of this message have been removed]
---------------------------------
Don't get soaked. Take a quick peek at the forecast
with theYahoo! Search weather shortcut.
[Non-text portions of this message have been removed]