We are converting our existing REST API service to gRPC core. While migrating existing classes understood that gRPC doesn't have a decimal datatype. We have a class in C# which is defined as
public class SalarySchedule
{
public decimal Salary { get; set; }
public DateTime? SalaryDate { get; set; }
}
And we implemented this in the proto file as
message SalarySchedule
{
// TODO: How to define this double to decimal
double Salary = 1;
google.protobuf.Timestamp SalaryDate =2;
}
For now, we have used double for Salary datatype. But this is causing a problem in internal calculations.
Can you please guide us, How can we define it as a decimal in gRPC?