Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • \$\begingroup\$ [int]$x+=$x/7 ? \$\endgroup\$ Commented Aug 17, 2018 at 4:21
  • \$\begingroup\$ @mazzy That fails for x=25. You have to truncate but casting to int rounds \$\endgroup\$ Commented Aug 17, 2018 at 20:05
  • \$\begingroup\$ Yes. And truncate is works \$\endgroup\$ Commented Aug 18, 2018 at 5:37
  • 1
    \$\begingroup\$ @mazzy I know, the only ways I know to truncate is either [math]::truncate() or the regex trick used above. [int]$x rounds the number. If you know a better way, I'm all ears. \$\endgroup\$ Commented Aug 20, 2018 at 20:01