Beispiel #1
0
        public override object Convert(object v, Type t, object p, CultureInfo c)
        {
            var duration = DoubleValueConverter.ToDouble(v, c);
            var cs       = (int)((duration - (int)duration) * 100);
            var sec      = ((int)duration % 60);
            var min      = ((int)duration / 60) % 60;
            var hr       = (int)duration / 3600;

            return($"{hr:00}:{min:00}:{sec:00}.{cs:00}");
        }
Beispiel #2
0
 public override object Convert(object v, Type t, object p, CultureInfo c) => double.IsNaN(DoubleValueConverter.ToDouble(v));
 protected MathConverter([NotNull] Func <double, double> To, [CanBeNull] Func <double, double> From = null)
     : this
     (
         (v, t, p, c) => To(DoubleValueConverter.ToDouble(v)),
         From is null
             ? new Func <object, Type, object, CultureInfo, object>(
Beispiel #4
0
        public override object Convert(object v, Type t, object p, CultureInfo c)
        {
            var value = DoubleValueConverter.ToDouble(v);

            return(value * -1);
        }