Hi,
I have input string value like “12.000” its in decimal i need only 2 digits after (.) like this 12.00 or 12 how can we do this i get error when i use the format
Can anyone help me?
Thanks
Chethan P
Hi,
I have input string value like “12.000” its in decimal i need only 2 digits after (.) like this 12.00 or 12 how can we do this i get error when i use the format
Can anyone help me?
Thanks
Chethan P
convert “taxval” to int , Like below
newintVariable = cint(taxval)
genaric is working but i am resiving the value is string i dont want to convert to string
AND if the value is 12.546 i need only 12.54
You can try this
Convert.ToDecimal("21.000").ToString("N")
or
CDbl("21.000").ToString("N")
Hi @copy_writes
Try like this
Math.Round(CDBl(taxval),2).ToString
Or
Math.Round(Convert.ToDecimal("12.000"),2).ToString
Just adding one more way as well
what is CDB1
CDBl -----------------> Convert to double
If it’s type double then you can use this syntax:
cdbl(Math.Round(existingvalue,2))
Thank you bro again you saved me and thanks to every one
Hi @copy_writes
If your issue is resolved, kindly mark the appropriate answer as solution so that we can close the topic
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.