using System.Net.Http.Json;
using System.Text.Json.Serialization;
using System.Globalization;
using Nullable.Extensions;
public static void Main()
Console.WriteLine(amount.ToCentime());
public static class AmountConverterBasic
public static long? ToCentime(this decimal? amountInEuro)
if (!amountInEuro.HasValue)
return ToCentime(amountInEuro.Value);
public static long ToCentime(this decimal amountInEuro) => (long)(amountInEuro * 100);
public static class AmountConverterNullable
public static long? ToCentime2(this decimal? amountInEuro) =>
amountInEuro.Map(x => (long)(x * 100));