CN117348741B - Method for displaying amount of amount input box and related equipment - Google Patents

Method for displaying amount of amount input box and related equipment Download PDF

Info

Publication number
CN117348741B
CN117348741B CN202311657964.9A CN202311657964A CN117348741B CN 117348741 B CN117348741 B CN 117348741B CN 202311657964 A CN202311657964 A CN 202311657964A CN 117348741 B CN117348741 B CN 117348741B
Authority
CN
China
Prior art keywords
data
input
amount
thousandth
bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311657964.9A
Other languages
Chinese (zh)
Other versions
CN117348741A (en
Inventor
石自军
于鹏
王德维
黄宇强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Jinzheng Software Technology Co ltd
Original Assignee
Shenzhen Jinzheng Software Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Jinzheng Software Technology Co ltd filed Critical Shenzhen Jinzheng Software Technology Co ltd
Priority to CN202311657964.9A priority Critical patent/CN117348741B/en
Publication of CN117348741A publication Critical patent/CN117348741A/en
Application granted granted Critical
Publication of CN117348741B publication Critical patent/CN117348741B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Input From Keyboards Or The Like (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The invention provides an amount display method of an amount input box and related equipment, wherein the method comprises the steps of monitoring whether the amount input box receives an input instruction or not in real time; when the input instruction is received by the amount input box, acquiring the existing character data and the new input data in the amount input box; judging whether the existing character data is display data with thousandth bits or not and judging whether the new input data is numerical data or not; if the existing character data is the display data with thousandth bits and the new input data is the numerical data, the original data of the existing character data is obtained from the assignment written back and bound by the amount input box; the original data and the new input data are pieced together to form combined input data; and converting the combined input data into target thousandth bit data by combining a regular expression with a replace function, and updating and displaying the target thousandth bit data in an amount input box. According to the invention, the user can automatically combine the data with the previous data each time and convert the data into the thousandth bit for display, so that the user can conveniently perceive the data size in real time.

Description

Method for displaying amount of amount input box and related equipment
Technical Field
The invention relates to the technical field of component development, in particular to an amount display method of an amount input box and related equipment.
Background
In the field of Web front-end development technology, many excellent teams develop open-source component libraries, such as: the element-ui, ant design and other convenient and excellent component libraries realize the effects of consistency, feedback, efficiency, controllability and other characteristics. But in the technical field of web front-end development, there is also a business requirement for the input and display of money, which is not currently implemented in component libraries and has certain defect problems in solutions existing in the market.
The common mode of the current money input box realized in the market is that the input box is consistent with a normal text input box, when the input box loses focus (stops inputting for a period of time), the displayed number is formatted into a display mode with a micrometer position.
Accordingly, the prior art is still in need of improvement and development.
Disclosure of Invention
The invention provides an amount display method of an amount input box and related equipment, and mainly aims to solve the technical problems in the prior art.
The first aspect of the present invention provides an amount display method of an amount input box, including:
monitoring whether the amount input box receives an input instruction in real time;
when the input instruction is received by the amount input box, acquiring the existing character data and the new input data in the amount input box;
judging whether the existing character data is display data with thousandth bits or not, and judging whether the new input data is numerical data or not;
if the existing character data are display data with thousandth bits and the new input data are numerical data, original data of the existing character data are obtained from assignment of write-back binding of the amount input box;
the original data and the new input data are pieced together to form combined input data;
and converting the combined input data into target thousandth bit data by combining a regular expression with a replace function, and updating and displaying the target thousandth bit data in the amount input box.
In an optional implementation manner of the first aspect of the present invention, the determining whether the existing character data is display data with a thousandth bit includes:
respectively defining a first formatted regular expression and a second formatted regular expression for matching the integer form thousandth bit display data and the decimal form thousandth bit display data;
traversing each character of the existing character data to judge whether decimal point characters exist or not;
if the existing character data has decimal characters, the second formatting regular expression is called to match the existing character data, and if the existing character data does not have decimal characters, the first formatting regular expression is called to match the existing character data;
and when the existing character data meets the matching condition of the first formatted regular expression or the second formatted regular expression, judging that the existing character data is display data with thousandth bits.
In an optional implementation manner of the first aspect of the present invention, the determining whether the existing character data is display data with thousandth bits, and determining whether the new input data is numerical data further includes:
if the existing character data is not the micrometer bit display data, further judging whether the existing character data is continuous numerical data or not;
if the existing character data are continuous numerical data, judging whether the new input data are numerical data or not;
if the new input data is numerical data, the new input data and the existing character data are directly combined to obtain direct pieced input data;
and converting the direct pieced input data into target thousandth bit data by combining a regular expression with a replace function, and updating and displaying the target thousandth bit data in the amount input frame.
In an optional implementation manner of the first aspect of the present invention, the converting the combined input data into the target thousandth bit data by combining a regular expression with a replace function and updating and displaying the target thousandth bit data in the amount input box includes:
judging whether decimal points exist in the combined input data;
if the decimal point exists in the combined input data, separating the decimal point and the subsequent part of the combined input data from the integer part in a decimal point identification mode;
constructing a String type replay function with a third formatted regular expression for thousandth bit division of the integer;
adding a thousand number to the integer part of the combined input data through the String type replay function to obtain thousandth bit display integer data;
and reorganizing the dial display integer data, the decimal point of the combined input data and the subsequent part to obtain target dial data, and updating and displaying the target dial data in the amount input frame.
In an optional implementation manner of the first aspect of the present invention, after the step of stitching the original data and the new input data to form combined input data, the method further includes: and writing the combined input data back and binding the combined input data into the assignment of the amount input box.
In an optional implementation manner of the first aspect of the present invention, after the converting the combined input data into the target thousandth bit data by combining a regular expression with a replace function and updating and displaying the target thousandth bit data in the amount input box, the method includes:
recording the current position of the positioning cursor before input by using the self-contained selectionStart attribute of the webpage element;
acquiring a first character length of the existing character data and a second character length of the target thousandth bit data;
obtaining a character increment by subtracting the first character length from the second character length;
the position cursor is shifted by the character delta to the latest input position using the selectionStart attribute and the selectionEnd attribute.
In an optional implementation manner of the first aspect of the present invention, the monitoring, in real time, whether the amount input box receives an input instruction includes:
a character input monitoring process is awakened in response to the flashing of a cursor in the monetary input box;
monitoring character input in the monetary input box by the character input monitoring process;
when the character input in the amount input box is monitored, the amount input box is judged to receive an input instruction.
The second aspect of the present invention provides an amount display system of an amount input box, the amount display system of the amount input box comprising:
the instruction monitoring module is used for monitoring whether the amount input box receives an input instruction or not in real time;
the data acquisition module is used for acquiring the existing character data and the new input data in the amount input box when the amount input box is monitored to receive an input instruction;
the data judging module is used for judging whether the existing character data are display data with thousandth bits or not and judging whether the new input data are numerical data or not;
the data retrieval module is used for obtaining original data of the existing character data from the assigned value of the write-back binding of the amount input box if the existing character data is display data with thousandth bits and the new input data is numerical data;
the data combination module is used for piecing the original data and the new input data into combined input data;
and the data conversion module is used for converting the combined input data into target thousandth bit data in a mode of combining regular expressions with a replace function and updating and displaying the target thousandth bit data in the amount input box.
A third aspect of the present invention provides an amount display apparatus of an amount input frame, the amount display apparatus of the amount input frame including: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line;
the at least one processor invokes the instructions in the memory to cause the amount display device of the amount input box to perform an amount display method of the amount input box as described in any one of the above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of displaying an amount of an amount input box as defined in any one of the above.
The beneficial effects are that: the invention provides an amount display method of an amount input box and related equipment, wherein the method comprises the steps of monitoring whether the amount input box receives an input instruction or not in real time; when the input instruction is received by the amount input box, acquiring the existing character data and the new input data in the amount input box; judging whether the existing character data is display data with thousandth bits or not and judging whether the new input data is numerical data or not; if the existing character data is the display data with thousandth bits and the new input data is the numerical data, the original data of the existing character data is obtained from the assignment written back and bound by the amount input box; the original data and the new input data are pieced together to form combined input data; and converting the combined input data into target thousandth bit data by combining a regular expression with a replace function, and updating and displaying the target thousandth bit data in an amount input box. According to the invention, the user can automatically combine the data with the previous data each time and convert the data into the thousandth bit for display, so that the user can conveniently sense the data size in real time.
Drawings
FIG. 1 is a diagram illustrating an embodiment of a method for displaying an amount of an amount input box according to the present invention;
FIG. 2 is a diagram of an embodiment of an amount display system of an amount input box of the present invention;
fig. 3 is a schematic diagram of an embodiment of an amount display device of an amount input box according to the present invention.
Detailed Description
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a specific flow of an embodiment of the present invention is described below, referring to fig. 1, and a first aspect of the present invention provides an amount display method of an amount input box, including:
s100, monitoring whether the amount input box receives an input instruction in real time; in the invention, step S100 is to monitor each time the character is input into the amount input box, and the monitoring mode may be that the user responds once every time when inputting one character, or that the user responds once when inputting N characters within a certain time after starting to input the character, and the adopted response mode depends on the requirement of the actual scene of the user.
In an optional implementation manner of the first aspect of the present invention, the monitoring, in real time, whether the amount input box receives an input instruction includes: a character input monitoring process is awakened in response to the flashing of a cursor in the monetary input box; monitoring character input in the monetary input box by the character input monitoring process; when the character input in the amount input box is monitored, the amount input box is judged to receive an input instruction. In this embodiment of the present invention, whether the user enters the ready state is mainly determined by whether a cursor (for example, a vertical line that can flash) is generated in the amount input box, after the user enters the ready state, whether the data input interface (hardware or virtual keyboard input data) receives the value input by the user is monitored, and if the data input interface receives the value input by the user, it is determined that the step of converting the subsequent para-input data and the existing data into the thousandth bit is required.
S200, when the input instruction is received by the amount input box, acquiring the existing character data and the new input data in the amount input box; in the invention, the existing character data is the data displayed in the amount input box before the current input, the data displayed in the amount input box before the current input can be the data displayed by the thousandth bits based on the diversity of actual scenes, or can be unconverted data with dimensions meeting the condition of thousandth bit conversion.
S300, judging whether the existing character data is display data with thousandth bits or not, and judging whether the new input data is numerical data (including integer numerical data and decimal numerical data or not); in the invention, the purpose of judging whether the existing character data is the display data with the thousandth bit is mainly to confirm whether the existing character data belongs to a convertible type, after the existing character data belongs to the convertible type, the existing character data can be directly reversely converted into the data without the thousandth bit.
In an optional implementation manner of the first aspect of the present invention, the determining whether the existing character data is display data with a thousandth bit includes:
respectively defining a first formatted regular expression and a second formatted regular expression for matching the integer form thousandth bit display data and the decimal form thousandth bit display data; in the invention, whether the existing character data is the display data of the dial number is 2, one is the display data of the integer form and the other is the display data of the decimal form, the numerical characteristics of the display data of the integer form and the display data of the decimal form are different, so that different formatted regular expressions are required to be matched, in another optional embodiment of the invention, the display data of the integer form can also be directly judged in the form of matching the dial number, namely, whether the existing character data is provided with the dial number is judged firstly, and then, the number between the two dial numbers is 3 from the right; taking decimal place display data as an example, an exemplary second formatted regular expression may be/(\d) (;
traversing each character of the existing character data to judge whether decimal point characters exist or not; in the invention, judging whether the display data of the thousandth bit is the display data of the integer form and the display data of the decimal form is mainly through judging whether decimal points exist in the display data of the thousandth bit, traversing the traversing sequence in the invention from right to left, sequentially acquiring each character of the existing character data, and then judging whether the character data is the decimal points;
if the existing character data has decimal characters, the second formatting regular expression is called to match the existing character data, and if the existing character data does not have decimal characters, the first formatting regular expression is called to match the existing character data; in the invention, the existing character data has decimal points, the second formatted regular expression with decimal point characteristics is used for matching, and if no decimal point exists, the first formatted regular expression with integer characteristics is used for matching;
and when the existing character data meets the matching condition of the first formatted regular expression or the second formatted regular expression, judging that the existing character data is display data with thousandth bits. In the invention, as long as the existing character data meets the matching condition of the first formatted regular expression or the second formatted regular expression, the existing character data is proved to be display data with thousandth bits (namely, the existing character data belongs to a convertible character type), and the existing character data can be combined with new input data to be converted again with thousandth bits in the later stage.
S400, if the existing character data are display data with thousandth bits and the new input data are numerical data, original data of the existing character data are obtained from assignment written back and bound by the amount input box; in the present invention, if the existing character data is the display data with thousandths and the new input data is the numerical data, it is proved that the existing character data is also the numerical data, meanwhile, the new input data is also the numerical data, and the two are subsequently recombined and then converted into new display data with thousandths, according to the input habit, if the existing character data is the decimal data, the new input data should be the integer data inserted into the existing character data, if the existing character data is the integer data, the new input data may be the integer data or the decimal data, in the present invention, before the existing character data and the new input data are recombined, the original data before the existing character data is not converted into the display data with thousandths need to be obtained, in the present invention, 2 alternative ways are available, one is directly obtained from the input frame write-back binding, and the other is directly obtained from the input frame of the original data with the same conversion efficiency, and the same order of the conversion efficiency is improved by using the reverse conversion function, and the conversion frame is not converted into the same type of the original data.
S500, the original data and the new input data are pieced together to form combined input data; generally, this step is performed after the new input data is written to the original data, and of course, in some special cases, the new input data may need to be interleaved in the original data, and in this case, it is better to insert the new input data into the corresponding position in the original data; in an optional implementation manner of the first aspect of the present invention, in order to reduce a subsequent step of inverse conversion of the display data with a thousandth bit, after the step of stitching the original data and the new input data to form combined input data, the method further includes: and writing the combined input data back and binding the combined input data into the assignment of the amount input box.
S600, converting the combined input data into target thousandth bit data through a mode of combining regular expressions with a replace function, and updating and displaying the target thousandth bit data in the amount input box. In the present invention, adding a thousandth bit symbol to the combined input data by combining a regular expression with a replace function may have a faster efficiency, and illustratively, the replace function and the regular expression used in the present invention may be replace ((\d) (.
In another alternative embodiment of the first aspect of the present invention, the separating the integer part of the combined input data for processing alone, that is, the converting the combined input data into the target thousandth-bit data by combining the regular expression with the replay function and updating the target thousandth-bit data displayed in the amount input box includes: judging whether decimal points exist in the combined input data; if the decimal point exists in the combined input data, separating the decimal point and the subsequent part of the combined input data from the integer part in a decimal point identification mode; constructing a String type replay function with a third formatted regular expression for thousandth bit division of the integer; adding a thousand number to the integer part of the combined input data through the String type replay function to obtain thousandth bit display integer data; and reorganizing the dial display integer data, the decimal point of the combined input data and the subsequent part to obtain target dial data, and updating and displaying the target dial data in the amount input frame.
In an optional implementation manner of the first aspect of the present invention, after the converting the combined input data into the target thousandth bit data by combining a regular expression with a replace function and updating and displaying the target thousandth bit data in the amount input box, the method includes:
recording the current position of the positioning cursor before input by using the self-contained selectionStart attribute of the webpage element; acquiring a first character length of the existing character data and a second character length of the target thousandth bit data; obtaining a character increment by subtracting the first character length from the second character length; the position cursor is shifted by the character delta to the latest input position using the selectionStart attribute and the selectionEnd attribute. In the present invention, the embodiment is mainly directed to the case that the original data of the existing character data is an integer, when the original data of the existing character data is a non-integer (i.e. the cursor is between characters of the existing character data), the calculated character increment also needs to be added with the offset of the positioning cursor from the tail of the last character of the existing character data before inputting.
In an optional implementation manner of the first aspect of the present invention, the determining whether the existing character data is display data with thousandth bits, and determining whether the new input data is numerical data further includes:
if the existing character data is not the micrometer bit display data, further judging whether the existing character data is continuous numerical data or not; if the existing character data are continuous numerical data, judging whether the new input data are numerical data or not; if the new input data is numerical data, the new input data and the existing character data are directly combined to obtain direct pieced input data; and converting the direct pieced input data into target thousandth bit data by combining a regular expression with a replace function, and updating and displaying the target thousandth bit data in the amount input frame. In this embodiment of the present invention, generally, the data of the existing character data is relatively short, and does not meet the condition of division of the thousandth bits, so that division of the thousandth bits needs to be performed in combination with the subsequent input data, and in the specific process of conversion in this step, if the direct-pieced input data is also data containing decimal points, the direct-pieced input data may be extracted from the direct-pieced input data into the thousandth bit data after the display of the thousandth bits, and then the data of the decimal points is spliced to the converted thousandth bit data of the integer part.
In general, the invention provides an amount display method of an amount input box, which is characterized in that whether characters input by the amount input box are preset requirements is judged, and after the characters input by the amount input box meet the preset requirements, a thousands of-minute amount display mode is automatically formatted, so that the method is not influenced by other characters, and the method is beneficial to increasing the readability and the accuracy of data during check-up and account checking operation of accountants and financial staff. For specific judgment conditions, one of the judgment conditions adopts a formatted regular expression: /(d) (. The realization logic is that firstly, the micrometer data input in the amount input box is replaced by a character string without micrometer bits through a regular expression replacement (/,/g,') and then formatted into a required result through the formatting regular expression, and the other mode is that the automatic write-back data is utilized to reduce the reverse conversion process, so that the development engineer reduces the code quantity and the workload when writing codes so as to achieve the functions of code readability and maintainability of the whole project.
Referring to fig. 2, a second aspect of the present invention provides an amount display system of an amount input box, the amount display system of the amount input box including:
the instruction monitoring module 10 is used for monitoring whether the amount input box receives an input instruction or not in real time;
the data acquisition module 20 is configured to acquire existing character data and new input data in the amount input box when it is monitored that the amount input box receives an input instruction;
the data judging module 30 is configured to judge whether the existing character data is display data with a thousandth bit, and judge whether the new input data is numerical data;
the data retrieving module 40 is configured to obtain original data of the existing character data from the assigned value of the write-back binding of the amount input box if the existing character data is display data with thousandth bits and the new input data is numerical data;
a data combining module 50 for stitching the original data and the new input data into combined input data;
the data conversion module 60 is configured to convert the combined input data into target thousandth bit data by combining a regular expression with a replace function, and update and display the target thousandth bit data in the amount input box.
In an optional implementation manner of the second aspect of the present invention, the data determining module includes:
the expression definition unit is used for respectively defining a first formatted regular expression and a second formatted regular expression which are used for matching the integer form thousandth bit display data and the decimal form thousandth bit display data;
the character traversing unit is used for traversing each character of the existing character data to judge whether decimal point characters exist or not;
the character matching unit is used for calling the second formatting regular expression to match the existing character data if the existing character data has the decimal point character, and calling the first formatting regular expression to match the existing character data if the existing character data does not have the decimal point character;
and the judging unit is used for judging that the existing character data is thousandth bit display data when the existing character data meets the matching condition of the first formatted regular expression or the second formatted regular expression.
In an optional implementation manner of the second aspect of the present invention, the money amount display system of the money amount input box further includes:
the data continuation judging module is used for further judging whether the existing character data are continuous numerical data or not if the existing character data are not the micrometer display data; and if the existing character data is continuous numerical data, judging whether the new input data is numerical data or not;
the data direct splicing module is used for directly combining the new input data with the existing character data to obtain direct spliced input data if the new input data are numerical data;
and the spelling data conversion module is used for converting the direct spelling input data into target thousandth bit data by combining a regular expression with a replace function and updating and displaying the target thousandth bit data in the amount input frame.
In an alternative embodiment of the second aspect of the present invention, the data conversion module includes:
a decimal point judging unit for judging whether decimal points exist in the combined input data;
the data separation unit is used for separating the decimal point and the subsequent part of the combined input data from the integer part in a decimal point identification mode if the decimal point exists in the combined input data;
the function construction unit is used for constructing a String type replay function with a third formatted regular expression, wherein the String type replay function is used for carrying out thousandth bit division on integer;
the data dividing unit is used for adding the integer part of the combined input data with a kilo-deci number through the String type replay function to obtain micrometer bit display integer data;
and the data reorganization unit is used for reorganizing the micrometer bit display integer data, the decimal point of the combined input data and the subsequent part to obtain target micrometer bit data, and updating and displaying the target micrometer bit data in the amount input frame.
In an optional implementation manner of the second aspect of the present invention, the money amount display system of the money amount input box further includes: and the data write-back binding module is used for write-back binding the combined input data to the assignment of the amount input box.
In an optional implementation manner of the second aspect of the present invention, the money amount display system of the money amount input box further includes:
the cursor position acquisition module is used for recording the current position of the positioning cursor before input by using the selection start attribute of the element of the webpage;
the character length statistics module is used for acquiring a first character length of the existing character data and a second character length of the target thousandth bit data;
the character increment calculating module is used for obtaining character increment by subtracting the first character length from the second character length;
and the cursor repositioning module is used for repositioning the character increment by using the selectionStart attribute and the selectionEnd attribute.
In an alternative embodiment of the second aspect of the present invention, the instruction monitoring module includes:
the process response awakening unit is used for awakening character input monitoring processes in response to the flashing of a cursor in the monetary input box;
the data monitoring unit is used for monitoring character input in the monetary input box through the character input monitoring process;
and the input judging unit is used for judging that the input instruction is received by the monetary input box when the occurrence of character input in the monetary input box is monitored.
Fig. 3 is a schematic diagram of an amount display device of an amount input box according to an embodiment of the present invention, where the amount display device of the amount input box may have a relatively large difference due to different configurations or performances, and may include one or more processors 70 (central processing units, CPU) (e.g., one or more processors) and a memory 80, and one or more storage media 90 (e.g., one or more mass storage devices) for storing application programs or data. The memory and storage medium may be transitory or persistent. The program stored in the storage medium may include one or more modules (not shown), each of which may include a series of instruction operations in the amount display device of the amount input box. Still further, the processor may be configured to communicate with the storage medium and execute a series of instruction operations in the storage medium on the money amount display device of the money amount input box.
The money display device of the money input box of the present invention may also include one or more power supplies 100, one or more wired or wireless network interfaces 110, one or more input/output interfaces 120, and/or one or more operating systems, such as Windows Serve, mac OS X, unix, linux, freeBSD, etc. It will be appreciated by those skilled in the art that the configuration of the money amount display device of the money amount input box shown in fig. 3 does not constitute a limitation of the money amount display device of the money amount input box, and may include more or less components than those illustrated, or may combine certain components, or may be arranged in different components.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, or may be a volatile computer readable storage medium, where instructions are stored in the computer readable storage medium, when the instructions are executed on a computer, cause the computer to perform the steps of the method for displaying an amount of the amount input box.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system or the unit described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1. An amount display method of an amount input box, comprising:
monitoring whether the amount input box receives an input instruction in real time;
when the input instruction is received by the amount input box, acquiring the existing character data and the new input data in the amount input box;
judging whether the existing character data is display data with thousandth bits or not, and judging whether the new input data is numerical data or not;
if the existing character data are display data with thousandth bits and the new input data are numerical data, original data of the existing character data are obtained from assignment of write-back binding of the amount input box;
the original data and the new input data are pieced together to form combined input data;
converting the combined input data into target thousandth bit data by combining a regular expression with a replace function, and updating and displaying the target thousandth bit data in the amount input frame;
the step of converting the combined input data into target thousandth bit data by combining a regular expression with a replace function and updating and displaying the target thousandth bit data in the amount input box comprises the following steps:
judging whether decimal points exist in the combined input data;
if the decimal point exists in the combined input data, separating the decimal point and the subsequent part of the combined input data from the integer part in a decimal point identification mode;
constructing a String type replay function with a third formatted regular expression for thousandth bit division of the integer;
adding a thousand number to the integer part of the combined input data through the String type replay function to obtain thousandth bit display integer data;
and reorganizing the dial display integer data, the decimal point of the combined input data and the subsequent part to obtain target dial data, and updating and displaying the target dial data in the amount input frame.
2. The method of claim 1, wherein determining whether the existing character data is thousandth bit display data comprises:
respectively defining a first formatted regular expression and a second formatted regular expression for matching the integer form thousandth bit display data and the decimal form thousandth bit display data;
traversing each character of the existing character data to judge whether decimal point characters exist or not;
if the existing character data has decimal characters, the second formatting regular expression is called to match the existing character data, and if the existing character data does not have decimal characters, the first formatting regular expression is called to match the existing character data;
and when the existing character data meets the matching condition of the first formatted regular expression or the second formatted regular expression, judging that the existing character data is display data with thousandth bits.
3. The method of claim 1, wherein the determining whether the existing character data is display data of thousandth bits, and the determining whether the new input data is numerical data further comprises:
if the existing character data is not the micrometer bit display data, further judging whether the existing character data is continuous numerical data or not;
if the existing character data are continuous numerical data, judging whether the new input data are numerical data or not;
if the new input data is numerical data, the new input data and the existing character data are directly combined to obtain direct pieced input data;
and converting the direct pieced input data into target thousandth bit data by combining a regular expression with a replace function, and updating and displaying the target thousandth bit data in the amount input frame.
4. The method of claim 1, wherein the step of stitching the original data and the new input data to form combined input data further comprises: and writing the combined input data back and binding the combined input data into the assignment of the amount input box.
5. The method for displaying an amount of an amount input box according to claim 1, wherein said converting said combined input data into target thousandth bit data by means of a regular expression in combination with a replace function and updating said target thousandth bit data for display in said amount input box comprises:
recording the current position of the positioning cursor before input by using the self-contained selectionStart attribute of the webpage element;
acquiring a first character length of the existing character data and a second character length of the target thousandth bit data;
obtaining a character increment by subtracting the first character length from the second character length;
the position cursor is shifted by the character delta to the latest input position using the selectionStart attribute and the selectionEnd attribute.
6. The method of claim 1, wherein monitoring in real time whether the input command is received by the money input box comprises:
a character input monitoring process is awakened in response to the flashing of a cursor in the monetary input box;
monitoring character input in the monetary input box by the character input monitoring process;
when the character input in the amount input box is monitored, the amount input box is judged to receive an input instruction.
7. An amount display system of an amount input box, characterized in that the amount display system of the amount input box comprises:
the instruction monitoring module is used for monitoring whether the amount input box receives an input instruction or not in real time;
the data acquisition module is used for acquiring the existing character data and the new input data in the amount input box when the amount input box is monitored to receive an input instruction;
the data judging module is used for judging whether the existing character data are display data with thousandth bits or not and judging whether the new input data are numerical data or not;
the data retrieval module is used for obtaining original data of the existing character data from the assigned value of the write-back binding of the amount input box if the existing character data is display data with thousandth bits and the new input data is numerical data;
the data combination module is used for piecing the original data and the new input data into combined input data;
the data conversion module is used for converting the combined input data into target thousandth bit data in a mode of combining regular expressions with a replace function and updating and displaying the target thousandth bit data in the amount input frame;
the data conversion module comprises:
a decimal point judging unit for judging whether decimal points exist in the combined input data;
the data separation unit is used for separating the decimal point and the subsequent part of the combined input data from the integer part in a decimal point identification mode if the decimal point exists in the combined input data;
the function construction unit is used for constructing a String type replay function with a third formatted regular expression, wherein the String type replay function is used for carrying out thousandth bit division on integer;
the data dividing unit is used for adding the integer part of the combined input data with a kilo-deci number through the String type replay function to obtain micrometer bit display integer data;
and the data reorganization unit is used for reorganizing the micrometer bit display integer data, the decimal point of the combined input data and the subsequent part to obtain target micrometer bit data, and updating and displaying the target micrometer bit data in the amount input frame.
8. An amount display device of an amount input box, characterized in that the amount display device of the amount input box comprises: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line;
the at least one processor invokes the instructions in the memory to cause the amount display device of the amount input box to perform the amount display method of the amount input box as recited in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements the amount display method of the amount input box of any one of claims 1 to 6.
CN202311657964.9A 2023-12-06 2023-12-06 Method for displaying amount of amount input box and related equipment Active CN117348741B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311657964.9A CN117348741B (en) 2023-12-06 2023-12-06 Method for displaying amount of amount input box and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311657964.9A CN117348741B (en) 2023-12-06 2023-12-06 Method for displaying amount of amount input box and related equipment

Publications (2)

Publication Number Publication Date
CN117348741A CN117348741A (en) 2024-01-05
CN117348741B true CN117348741B (en) 2024-02-06

Family

ID=89367199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311657964.9A Active CN117348741B (en) 2023-12-06 2023-12-06 Method for displaying amount of amount input box and related equipment

Country Status (1)

Country Link
CN (1) CN117348741B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111221603A (en) * 2019-10-30 2020-06-02 深圳前海微众银行股份有限公司 Information input method and device based on input box
WO2021012891A1 (en) * 2019-07-23 2021-01-28 平安科技(深圳)有限公司 Vehicle loss assessment method, device, apparatus, and storage medium
CN116795359A (en) * 2022-12-30 2023-09-22 兴业银行股份有限公司 Method and system for realizing monetary assembly based on vue

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912311A (en) * 2015-12-11 2016-08-31 乐视移动智能信息技术(北京)有限公司 Method and device for intuitively prompting payment amount

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021012891A1 (en) * 2019-07-23 2021-01-28 平安科技(深圳)有限公司 Vehicle loss assessment method, device, apparatus, and storage medium
CN111221603A (en) * 2019-10-30 2020-06-02 深圳前海微众银行股份有限公司 Information input method and device based on input box
CN116795359A (en) * 2022-12-30 2023-09-22 兴业银行股份有限公司 Method and system for realizing monetary assembly based on vue

Also Published As

Publication number Publication date
CN117348741A (en) 2024-01-05

Similar Documents

Publication Publication Date Title
JP6033235B2 (en) Formatting data by example
US8024297B2 (en) Data logging system and method thereof for heterogeneous data
US8190578B2 (en) Migration of versioned data between configuration management systems
CN110334326B (en) A kind of method and system for identifying recipe file and being converted into XML file
CN111625535B (en) Method, device and storage medium for realizing business data association
CN109634970A (en) Table method of data synchronization, equipment, storage medium and device
CN115730008A (en) Log analysis method, data synchronization system, electronic device and storage medium
CN114201615B (en) Scientific research data change review method and server based on data snapshot
CN117348741B (en) Method for displaying amount of amount input box and related equipment
CN112506869A (en) File processing method, device and system
US20060248443A1 (en) System and method for exporting spreadsheet data
CN113703753B (en) Method and device for product development and product development system
CN112162964B (en) Self-adaptive data synchronization method, device, computer equipment and storage medium
CN114861614A (en) Method and device for filling data, electronic equipment and medium
JP4527697B2 (en) Leaked personal information search system, leaked personal information search method, leaked personal information search device and program
US6385763B1 (en) Methodology for mapping use cases to operations for operational profile development
US6357002B1 (en) Automated extraction of BIOS identification information for a computer system from any of a plurality of vendors
CN109697216B (en) Clearing transaction information processing method, device and system
CN112836033A (en) Business model management method, device, equipment and storage medium
CN107612919B (en) Protocol configuration method and device
JP2004310186A (en) Automatic journalization process, device for implementing it, its process program, and recording medium
CN112783927B (en) Database query method and system
CN115051904B (en) Method and device for managing single disk state based on markup language
CN112130841B (en) SQL development method and device and terminal equipment
CN111882430B (en) Intelligent scheduling method and device for banking system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant