# How to format a Variant type variable when displaying it as a string?

**URL:** https://www.finalbuilder.com/forums/t/how-to-format-a-variant-type-variable-when-displaying-it-as-a-string/4587
**Category:** Discussion
**Created:** [October 23, 2014, 4:47am UTC](https://www.finalbuilder.com/forums/t/how-to-format-a-variant-type-variable-when-displaying-it-as-a-string/4587 "2014-10-23T04:47:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jonathanmeltzer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jonathanmeltzer](https://www.finalbuilder.com/forums/u/jonathanmeltzer)
#### Post date: [October 23, 2014, 4:47am UTC](https://www.finalbuilder.com/forums/t/how-to-format-a-variant-type-variable-when-displaying-it-as-a-string/4587/1 "2014-10-23T04:47:39Z")

</div>

I am doing a Simple Maths action to calculate a percentage (actually 2 - I multiply the numerator by 100, then divide it by the denominator). &nbsp;The resulting variable is a Variant, and ends up with 12 digits after the decimal point. &nbsp;I only want 1 or 2 digits after the decimal, e.g. 75.2 or 70.34. &nbsp;  
  
Is there a way to format a variable when displaying it? &nbsp;I could not see a way to do that, and since it is a Variant, the format field is not open in the variable definition window. &nbsp;I figure I must be missing something.  
  
Thanks,  
  
Jonathan

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [October 24, 2014, 3:13am UTC](https://www.finalbuilder.com/forums/t/how-to-format-a-variant-type-variable-when-displaying-it-as-a-string/4587/2 "2014-10-24T03:13:31Z")

</div>

The formatstring doesn’t apply to variants because it’s not possible (the format function we call cannot deal with variants). Is there any reason you don’t use a Float variable type to store your result?
