How can I display negative numbers in right to left textbox, with the minus on the left of the number?
Current state: 1-
Desired state: -1
On your textbox you just need to reset the direction, and align the text to the right:
BODY {
direction: rtl;
}
#test {
direction: ltr;
text-align: right
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
Lorem ipsum dolor sit amet consectetuer adipiscing elit. Lorem ipsum dolor sit amet consectetuer adipiscing elit. Lorem ipsum dolor sit amet consectetuer adipiscing elit. Lorem ipsum dolor sit amet consectetuer adipiscing elit.<br />
<input type="text" id="test" value="-109309" />
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With