In SolidWorks part & assembly global variables decimal point are controllable?
D=0.53 but i need only 0.5
A=0.01396 i need only 0.014
B=0.00159 i need only 0.0016
It is passable in SolidWorks global variables?
You can use the format function with desired decimal places. Check this article (Display Mass in Dual Units in SolidWorks ) and scroll to bottom steps to see an example of using format function.
I tried but it is not working
=Format(500*0.02,"#.##") this is the right way ?
I would suggest using the ROUND function:
Round a number down by using the ROUNDDOWN function. It works just the same as ROUND, except that it always rounds a number down. For example, if you want to round down 3.14159 to three decimal places: =ROUNDDOWN(3.14159,3) which equals 3.141.
This can also be used to round up:
Hope this helps.
You have typed it correctly but it seems like Format method is not working in latest version of SW, so you can simply use the round method suggested by Albie Waterton
I Tried ROUNDUP but it not working, There is any other way, please?
Try only with ROUND function.
Manivannan Panneerselvam wrote:
ROUND should be round. Capital letters are not recognized in functions. You should use lowercase letters in this case.
use it this way
= round ( 5 * 0.351 , 1 )
More examples here:
Thank you all
Habib Ghalamkari wrote:ROUND should be round. Capital letters are not recognized in functions.
Habib Ghalamkari wrote:
ROUND should be round. Capital letters are not recognized in functions.
Capital letters works fine for me
Capital letters should have no bearing on this example.
You need to include the space after the function 'ROUNDUP'
ROUNDUP does not work in SW, at least not in 2017.
I have done a bit of testing myself, and it looks like the ability to use 'Roundup' is not available in SWK's 2017 but you can still get the same result, but it requires a far longer equation. Round is still available but, I was able to find out by trial-and-error that the Round() function in the Solidworks Equation dialogue uses the common statistical rounding rules : If the number is even (4.50, 6.50, etc), it will round down whereas if it is an odd integer, it will round up (15.5 -> 16).
Example 1 (Odd-numbered Example)
( 1.5 * 15 + 1 - 0.25 ) / 1.5 = 15.5
INT(( 1.5 * 15 + 1 - 0.25 ) / 1.5) = 15
Round(( 1.5 * 15 + 1 - 0.25 ) / 1.5) =16
Example 2 (Even-numbered Example)
( 1 * 12 + 1 - 0.25 ) / 1.5 = 8.5
INT(( 1 * 12 + 1 - 0.25 ) / 1.5) = 8
Round(( 1 * 12 + 1 - 0.25 ) / 1.5) = 8
Alternatively, when you cant update to 2018 or newer, you could write the formula in an excel table and then link the global variable to an external file, this being the Excel table.
Hi Albie Waterton ,
Yes indeed, the spaces are important. SW 2018 adds the spaces automatically if you forget typing them.
Some additional info if you want to use the rounded value in a Drawing:
Retrieving data ...