Exemplo n.º 1
0
        /// <summary>
        /// ToLocallbWithoutUnitString
        /// </summary>
        /// <returns>string</returns>
        public string ToLocallbWithoutUnitString()
        {
            if (string.IsNullOrEmpty(this.Num))
            {
                return(string.Empty);
            }

            var temp = SetPatientWeight(this.Num);

            if (this.Unit == WeightUnit.Kg)
            {
                if (Num.EndsWith("."))
                {
                    return(Math.Round(temp * KgToLb, 0).ToString(CultureInfo.InvariantCulture) + ".");
                }
                return(Math.Round(temp * KgToLb, 2).ToString("0.00"));
            }
            else
            {
                if (Num.EndsWith("."))
                {
                    return(Math.Round(temp, 0).ToString(CultureInfo.InvariantCulture) + ".");
                }
                if (Num.EndsWith("0"))
                {
                    return(Num);
                }
                GlobalDefinition.LoggerWrapper.LogTraceInfo("public string ToLocallbWithoutUnitString() end ");
                return(Math.Round(temp, 2).ToString(CultureInfo.InvariantCulture));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// ToLocalKgWithoutUnitString
        /// </summary>
        /// <returns>string</returns>
        public string ToLocalKgWithoutUnitString()
        {
            if (string.IsNullOrEmpty(this.Num))
            {
                return(string.Empty);
            }

            var temp = SetPatientWeight(this.Num);

            if (this.Unit == WeightUnit.Lb)
            {
                if (Num.EndsWith("."))
                {
                    return(Math.Round(temp * LbToKg, 0).ToString(CultureInfo.InvariantCulture) + ".");
                }
                return(Math.Round(temp * LbToKg, 2).ToString("0.00"));
            }
            else
            {
                if (Num.EndsWith("."))
                {
                    return(Math.Round(temp, 0).ToString(CultureInfo.InvariantCulture) + ".");
                }
                if (Num.EndsWith("0"))
                {
                    return(Num);
                }
                return(Math.Round(temp, 2).ToString(CultureInfo.InvariantCulture));
            }
        }
Exemplo n.º 3
0
        public string ToLocalCmWithOutUnitString()
        {
            if (string.IsNullOrEmpty(this.Num))
            {
                return(string.Empty);
            }

            var temp = ConvertPatientHeight(this.Num);

            if (this.Unit == HeightUnit.Inch)
            {
                if (Num.EndsWith("."))
                {
                    return(Math.Round(temp * InchToCm, 0).ToString(CultureInfo.InvariantCulture) + ".");
                }
                return(Math.Round(temp * InchToCm, 2).ToString(CultureInfo.InvariantCulture));
            }
            else
            {
                if (Num.EndsWith("."))
                {
                    return(Math.Round(temp, 0).ToString(CultureInfo.InvariantCulture) + ".");
                }
                if (Num.EndsWith("0"))
                {
                    return(Num);
                }
                return(Math.Round(temp, 2).ToString(CultureInfo.InvariantCulture));
            }
        }