You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
694 B

1 year ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Microsoft.Maui;
  6. using Microsoft.Maui.Controls;
  7. namespace GMCabsDriverAssistant.Utils
  8. {
  9. public static class ExtensionMethods
  10. {
  11. public static int DecimalDigits(this decimal n)
  12. {
  13. return n.ToString(System.Globalization.CultureInfo.InvariantCulture)
  14. .SkipWhile(c => c != '.')
  15. .Skip(1)
  16. .Count();
  17. }
  18. public static bool IsDeletion(this TextChangedEventArgs e)
  19. {
  20. return !string.IsNullOrEmpty(e.OldTextValue) && e.OldTextValue.Length > e.NewTextValue.Length;
  21. }
  22. }
  23. }