Vb.net has a decimal data type.

Unlike normal double or floating points, decimal data type can store values like 0.1

Now say I have a variable like precision.

Say precision is 8

So basically I want to do

```
Protected Overridable Sub setPairsPricesStep2(decimalPrecission As Long, Optional base As String = "", Optional quote As String = "")
    If decimalPrecission = 8 Then
        Return
    End If
    Dim price = 10D ^ (-decimalPrecission)
    setPairsPriceStep1(price, base, quote)
End Sub

```

There is a problem there

the result of Dim price = 10D ^ (-decimalPrecission) is double, not decimal. I can convert it to decimal but then I will lost the precission.

So what is the right way to do it? Should I just use for next but that's hardly elegant.

It's simple

I want a function that given precisions give decimal value.

For example, if precision is 1 I got 0.1. If precision is 5, I got 0.00001

I ended up doing this

```
For i = 1 To decimalPrecission
    price *= 0.1D
Next

```

But surely there is a better way

Update:

Per comment, I tried

```
Dim e = 10D ^ -5
Dim e1 = 10D ^ -5L

```

The type of e and e1 are both double.

I suppose I can do Cdec(e). But then it means I have lost accuracy because normal double cannot store .1 correctly.