# Xform and floats

**URL:** https://forum.highend3d.com/t/xform-and-floats/5495
**Category:** Maya
**Tags:** mel
**Created:** [February 25, 2003, 6:12pm UTC](https://forum.highend3d.com/t/xform-and-floats/5495 "2003-02-25T18:12:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![agartha](https://forum.highend3d.com/user_avatar/forum.highend3d.com/agartha/32/54669_2.png) [@agartha](https://forum.highend3d.com/u/agartha)
#### Post date: [February 25, 2003, 6:12pm UTC](https://forum.highend3d.com/t/xform-and-floats/5495/1 "2003-02-25T18:12:04Z")

</div>

Why do the following print commands produce different results?

float $location[] = `xform -q -t -ws`;  
print($location[0] + " " + $location[1] + " " + $location[2] + "n");  
print($location);

For example, when executed on a single mesh vertex:  
-0.4999999925 0.4999999925 -0.4999999925  
-0.5  
0.5  
-0.5

I know what its doing, but I don't know why. What I would like to do is have control of the float precision, like .499 would be great.

Thanks,

-Ben

---

<div class="post-metadata">

### Author: ![warpcat](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/w/c89c15/32.png) [@warpcat](https://forum.highend3d.com/u/warpcat)
#### Post date: [February 25, 2003, 8:51pm UTC](https://forum.highend3d.com/t/xform-and-floats/5495/2 "2003-02-25T20:51:56Z")

</div>

your first print statement is concatenating the float array into a single string, and printing it, so it's all on one line. The second print statement is printing the actual array, so it prints each array element on a new line. My guess is that when converting it to a string, the decmil point accuracy is greater than when when printing an array.... but that's just a guess. Anyway, I bet they're actually the same values, just being displayed differently because one has been converted to a string, and one is left as a float array. Still, it is an interesting "feature" you've found... I hope someone else has a less 'wishy-washy' reply.... ![](http://64.32.63.100/forums/icons/wink.gif)
