This is my code that I have been attempting to use. I have a user input textbox1, where the user inputs a 30 digit value, that value needs to have '00' added to the end. making the value 32 digits. I want to apply a division to the input value, and apply some other calculations which involve finding the remainder. But the code when run, keeps throwing error that my value is too big or too small. I'm not sure how to add a truncation of the answer which I think will stop me getting the error. I have no idea how to do this. any help would be greatly appreciated. Many thanks.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Numerics;
using System.Windows.Forms;
using System.Text;
using System.IO;
namespace quickcalc
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public object Biginteger { get; private set; }
private void button1_Click(object sender, EventArgs e)
{
StreamWriter File = new StreamWriter("Test_File.txt");
File.WriteLine(textBox1.Text = (Biginteger.Parse(textBox1.Text + "00") / 97).ToString());
File.Close();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
What I have tried:
i have tried to use the 'long' function but even that threw the same error as my normal int32 which i was using originally. I'm unsure how to use the big integer function as adding the '
using System.Numerics
' highlights it as unnecessary.