bug1288834.js 718 B

1234567891011121314151617181920
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. function getRoundValue(n) {
  6. if (!(n == 0)) {
  7. return n.toFixed();
  8. }
  9. }
  10. WScript.Echo = function (n) {
  11. print(formatOutput(n.toString()));
  12. };
  13. function formatOutput(n) {
  14. return n.replace(/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/g, function () {
  15. return getRoundValue(parseFloat());
  16. });
  17. }
  18. WScript.Echo(0);
  19. WScript.Echo(0);