# Format not giving expected result in text field

**URL:** <https://forum.xojo.com/t/format-not-giving-expected-result-in-text-field/14206>\
**Category:** General\
**Created:** [February 9, 2014, 6:28pm UTC](https://forum.xojo.com/t/format-not-giving-expected-result-in-text-field/14206 "2014-02-09T18:28:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fred\_Schroeder](https://forum.xojo.com/letter_avatar_proxy/v4/letter/f/e19adc/32.png) [@Fred\_Schroeder](https://forum.xojo.com/u/Fred_Schroeder)\
**Post date:** [February 9, 2014, 6:28pm UTC](https://forum.xojo.com/t/format-not-giving-expected-result-in-text-field/14206/1 "2014-02-09T18:28:50Z")

</div>

I have an event in a popup menu change that looks like this(in part):

taxrate.Text = Format((taxpcnt/100),"##.###%")

where taxrate is a textfield. The weird thing is it is not showing up like the value should be, for instance if the taxpcnt = 8.125 it shows up in taxrate as 8.12 somewhere it loses the last number.

the result of the Format statement is giving the correct value, it just gets lost in the text field.

What am I overlooking here?

TIA,  
Fred

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [February 9, 2014, 6:34pm UTC](https://forum.xojo.com/t/format-not-giving-expected-result-in-text-field/14206/2 "2014-02-09T18:34:24Z")

</div>

is the “%” showing in your textfield?  
If not, then is the text field wide enough to show all the characters.

I just tried to duplicate your results, and cannot… unless I make the Textfield too small

---

<div class="post-metadata">

**Author:** ![Fred\_Schroeder](https://forum.xojo.com/letter_avatar_proxy/v4/letter/f/e19adc/32.png) [@Fred\_Schroeder](https://forum.xojo.com/u/Fred_Schroeder)\
**Post date:** [February 9, 2014, 7:00pm UTC](https://forum.xojo.com/t/format-not-giving-expected-result-in-text-field/14206/3 "2014-02-09T19:00:10Z")

</div>

yes, it is showing the %.

I am going to search and check to make sure I don’t have a function somewhere else that is re-calculating the percent and then posting to the textfield after my original calculation

---

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [February 9, 2014, 7:07pm UTC](https://forum.xojo.com/t/format-not-giving-expected-result-in-text-field/14206/4 "2014-02-09T19:07:36Z")

</div>

You are dividing the taxpcnt by 100 so I assume it is an Integer which implies you’ve lost the last digit somewhere.

---

<div class="post-metadata">

**Author:** ![Fred\_Schroeder](https://forum.xojo.com/letter_avatar_proxy/v4/letter/f/e19adc/32.png) [@Fred\_Schroeder](https://forum.xojo.com/u/Fred_Schroeder)\
**Post date:** [February 10, 2014, 1:35am UTC](https://forum.xojo.com/t/format-not-giving-expected-result-in-text-field/14206/5 "2014-02-10T01:35:58Z")

</div>

yep, had another method that was resetting the text property, and had the wrong format. Changed that and all is well now.

Thanks for you help guys!

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:04pm UTC](https://forum.xojo.com/t/format-not-giving-expected-result-in-text-field/14206/6 "2020-10-29T17:04:24Z")

</div>


