# I keep getting 9 decimal places in my text box Answer, I need only 3

Page 1 of 1

## 1 Replies - 251 Views - Last Post: 07 August 2012 - 12:01 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=288158&amp;s=385f296204eac225255b8a2e19187f36&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 tashunca

Reputation: 0
• Posts: 1
• Joined: 05-August 12

# I keep getting 9 decimal places in my text box Answer, I need only 3

Posted 06 August 2012 - 09:43 PM

```Private Sub cmdCalculate_Click()

If txtIFV * txtICV <> 0 Then X = 1 / (6.28 * txtIFV * txtICV)

If txtIRV * txtICV <> 0 Then Let X = 1 / (6.28 * txtIRV * txtICV)

If txtICV = 0 Then Let txtC = 1 / (6.28 * txtIFV * txtIRV * Tan(txtD + 1.57))

If txtIFV = 0 Then Let txtF = 1 / (6.28 * txtICV * txtIRV * Tan(txtD + 1.57))

If txtIRV = 0 Then Let txtR = X / Tan(txtD + 1.57)

```

ModEdit:- Happens in above line
```
Let D = -Abs(D / 57.3)

If txtD = 0 Then Let txtPA = Atn(X / txtIRV) - 1.57

txtCVL = txtD * 57.3

txtRVL = txtD * 57.3 + 90
```

1. I tried txtR.Text = Format(txtR.Text,"#000.00")
2. txtR.Text As Double = 0.000)
3. txtR.Text = (txtR.Text / 100).ToString("N2") please hlp.

This post has been edited by AdamSpeight2008: 07 August 2012 - 01:55 PM

Is This A Good Question/Topic? 0

## Replies To: I keep getting 9 decimal places in my text box Answer, I need only 3

### #2 Neku

• D.I.C Regular

Reputation: 18
• Posts: 255
• Joined: 21-May 09

## Re: I keep getting 9 decimal places in my text box Answer, I need only 3

Posted 07 August 2012 - 12:01 PM