# How do you calculate the number of digits after a decimal point

I'm trying to calculate the number of digits after the decimal point so that I can turn the total into a whole number.

Example: I have this data.

buy 0,69513 0,69614

buy 75,293 75,331

sold 37,44 37,58

In row one I have the formula

```
=IF(C28="buy";E28-D28;IF(C28="sold";D28-E28;0))
```

If I try

```
=IF(AND(C29="buy";"0,000000);*10000);E29-D29;IF(AND(C29="sold";0,00000);*100000;0"))
```

[erAck: made the formula a code block by breaking it into a new line and hitting Ctrl+K which indents it by 4 spaces; turns out the embedded `*`

asterisks were munged in the flow text display as they are control characters for *emphasized text*]

your 'try' formula looks a little confused to me ... as well the formula as the intention ... the question from the headline could be answered with

`=LEN(TEXT(MOD(E28;1);"0,####################"))-2`

Just added a few Enter, to format the question.

just check the double quotes in your question, tell where you have the data, and what you intend / expect the formula to do

looks better now, thks @erAck, but this section:

`;"0,000000);*10000);`

is still mysterious to meAbsolutely, it doesn't make sense at all. The author should correct that and also place the quotes where they belong..

hello @Hermes14,

i owe you some thanks because your question gave a kick to find and suggest some 'creative solutions' for the miserable floating-point-rounding problem, see: https://bugs.documentfoundation.org/s... and https://bugs.documentfoundation.org/s...,

thank you!,

i don't want to upvote your question at the moment because it still has grammatical errors, and it doesn't make sense to me to compare businesses by different magnification factors ...

happy hacking