# C# .NET - Crystal Report - Finding no . of digits in a number

*Asked By ***Sreya Gopal** on 19-Jun-13 10:05 AM

FORMULA 1 -GTKD

int(Sum ({tb_Main_Invoicing.tb_MainInv_GrandTot}, {tb_Main_Invoicing.tb_MainInv_InvoiceNo}))

FORMULA 2 -GTKD2

(tonumber(int(

{@GTKD})))-If the number is 100.524 ,i' am getting output as 100,

How can i rewrite the formula so that i can find the no. of digits in 100 ,(OUTPUT SHOULD BE 3)

**Robbe Morris** replied to **Sreya Gopal** on 19-Jun-13 11:53 AM

"int" must be a whole number. It doesn't support decimals. Try "double".

**Sreya Gopal** replied to **Robbe Morris** on 20-Jun-13 02:02 AM

purposelly i' m using the integer,i want only the integer. i'm asking how we can find the number of digits in the integer part

**Robbe Morris** replied to **Sreya Gopal** on 20-Jun-13 08:20 AM

Your sample number is "100.524". An int will automatically convert this to 100 whether you like it or not. You "must" use another numeric oriented data type if you want to evaluate numbers with decimals in them.

**Sreya Gopal** replied to **Robbe Morris** on 23-Jun-13 02:42 AM

What i' m asking and what your reply is both different

**Robbe Morris** replied to **Sreya Gopal** on 23-Jun-13 08:27 AM