mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-01 09:35:39 -05:00
Get server general properties (#2117)
* add server handler * get server general properties
This commit is contained in:
32
src/Microsoft.SqlTools.ServiceLayer/Utility/ByteConverter.cs
Normal file
32
src/Microsoft.SqlTools.ServiceLayer/Utility/ByteConverter.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Utility
|
||||
{
|
||||
public static class ByteConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts value in KBs to MBs
|
||||
/// </summary>
|
||||
/// <param name="valueInKb">value in kilo bytes</param>
|
||||
/// <returns>Returns as double type</returns>
|
||||
public static double ConvertKbtoMb(double valueInKb)
|
||||
{
|
||||
return (Math.Round(valueInKb / 1024, 2));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts value in MBs to GBs
|
||||
/// </summary>
|
||||
/// <param name="valueInMb">value in mega bytes</param>
|
||||
/// <returns>Returns as double type</returns>
|
||||
public static double ConvertMbtoGb(double valueInMb)
|
||||
{
|
||||
return (Math.Round(valueInMb / 1024, 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -345,15 +345,5 @@ namespace Microsoft.SqlTools.ServiceLayer.Utility
|
||||
return new string(nameChars);
|
||||
}
|
||||
private static readonly HashSet<char> illegalFilenameCharacters = new HashSet<char>(new char[] { '\\', '/', ':', '*', '?', '"', '<', '>', '|' });
|
||||
|
||||
/// <summary>
|
||||
/// Converts value in KBs to MBs
|
||||
/// </summary>
|
||||
/// <param name="valueInKb">value in kilo bytes</param>
|
||||
/// <returns>Returns as double type</returns>
|
||||
public static double ConvertKbtoMb(double valueInKb)
|
||||
{
|
||||
return (Math.Round(valueInKb / 1024, 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user