Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decimal read problem #19

Open
selcuk-ethica opened this issue May 20, 2022 · 1 comment
Open

decimal read problem #19

selcuk-ethica opened this issue May 20, 2022 · 1 comment

Comments

@selcuk-ethica
Copy link

1.18 versinon -> iyziCommissionRateAmount=0.40000000 write 40000000 (not show comma)
1.19 version -> not read

i want to read iyziCommissionRateAmount

JSON DATA
{"status":"success","locale":"tr","systemTime":1653066614838,"conversationId":"ETH1000","price":1.0,"paidPrice":10.0,"installment":1,"paymentId":"17604670","fraudStatus":1,"merchantCommissionRate":900.00000000,"merchantCommissionRateAmount":9.0,"iyziCommissionRateAmount":0.40000000,"iyziCommissionFee":0.25000000,"cardType":"DEBIT_CARD","cardAssociation":"MASTER_CARD","cardFamily":"Neo","binNumber":"589004","lastFourDigits":"0016","basketId":"ETH1000","currency":"TRY","itemTransactions":[{"itemId":"ETH1000","paymentTransactionId":"18814235","transactionStatus":2,"price":1.0,"paidPrice":10.00000000,"merchantCommissionRate":900.00000000,"merchantCommissionRateAmount":9.00000000,"iyziCommissionRateAmount":0.40000000,"iyziCommissionFee":0.25000000,"blockageRate":0E-8,"blockageRateAmountMerchant":0E-8,"blockageRateAmountSubMerchant":0,"blockageResolvedDate":"2022-05-28 00:00:00","subMerchantPrice":0,"subMerchantPayoutRate":0E-8,"subMerchantPayoutAmount":0,"merchantPayoutAmount":9.35000000,"convertedPayout":{"paidPrice":10.00000000,"iyziCommissionRateAmount":0.40000000,"iyziCommissionFee":0.25000000,"blockageRateAmountMerchant":0E-8,"blockageRateAmountSubMerchant":0E-8,"subMerchantPayoutAmount":0E-8,"merchantPayoutAmount":9.35000000,"iyziConversionRate":0,"iyziConversionRateAmount":0,"currency":"TRY"}}],"authCode":"222905","phase":"AUTH","hostReference":"mock00027iyzihostrfn"}

@derrickrpm
Copy link

I had this problem as well. Seems to not allow 8+ so I changed aj_ReadNumericValue to this as a quick fix since I didn't need that many digits anyway.

Private Function aj_ReadNumericValue(ByVal val)
	If Instr(val, ".") > 0 Then
		numdecimals = Len(val) - Instr(val, ".")
		If numdecimals > 7 then 'trim as 8+ errors
			val = left(val, Instr(val, ".") + 8)
			numdecimals = 7
		end if
		val = Clng(Replace(val, ".", ""))
		val = val / (10 ^ numdecimals)
		aj_ReadNumericValue = val
	Else
		aj_ReadNumericValue = Clng(val)
	End If
End Function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants