我尝试添加按钮以在其中添加逗号,如下所示:
protected void Button1_Click(object sender, System.EventArgs e) {
Number.Text = "";
string s = string.Format("{0:n0}",1234567890);
Number.Text += "value : 1234567890";
Number.Text += "<br />Thousands Separator: " + s;
Number.Text += "<br/><br />another solution";
int value = 1234567890;
string formatedstring = value .ToString("#,##0");
Number.Text += "<br />result: " + formatedstring;
}
但是,我希望在输入时立即更改它,类似于Unity中的更新功能。添加按钮功能非常不道德。
答案 0 :(得分:2)
为文本框中的文本更改事件。然后添加以下代码:
#include "main.h"
#include "stm32l4xx_hal.h"
#include "quadspi.h"
#include "gpio.h"
uint8_t ReadAddr = 0x9F;
uint8_t pBuffer[3];
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_QUADSPI_Init();
while (1)
{
HAL_QSPI_Transmit(&hqspi, &ReadAddr, 5);
HAL_QSPI_Receive(&hqspi, pBuffer, 5);
}
}